lkml.org 
[lkml]   [2008]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][2/3] Account and control virtual address space allocations
YAMAMOTO Takashi wrote:
>> diff -puN mm/swapfile.c~memory-controller-virtual-address-space-accounting-and-control mm/swapfile.c
>> diff -puN mm/memory.c~memory-controller-virtual-address-space-accounting-and-control mm/memory.c
>> --- linux-2.6.25-rc5/mm/memory.c~memory-controller-virtual-address-space-accounting-and-control 2008-03-16 22:57:40.000000000 +0530
>> +++ linux-2.6.25-rc5-balbir/mm/memory.c 2008-03-16 22:57:40.000000000 +0530
>> @@ -838,6 +838,11 @@ unsigned long unmap_vmas(struct mmu_gath
>>
>> if (vma->vm_flags & VM_ACCOUNT)
>> *nr_accounted += (end - start) >> PAGE_SHIFT;
>> + /*
>> + * Unaccount used virtual memory for cgroups
>> + */
>> + mem_cgroup_update_as(vma->vm_mm,
>> + ((long)(start - end)) >> PAGE_SHIFT);
>>
>> while (start != end) {
>> if (!tlb_start_valid) {
>
> i think you can sum and uncharge it with a single call.
>

Like nr_accounted? I'll have to duplicate nr_accounted since that depends
conditionally on VM_ACCOUNT.

--
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL


\
 
 \ /
  Last update: 2008-03-18 02:15    [from the cache]
©2003-2011 Jasper Spaans