Re: [PATCH 1/6] memcg: use global stat directly for root memcg usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 13, 2013 at 9:05 AM, Kamezawa Hiroyuki
<kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:
> (2013/03/12 19:08), Sha Zhengju wrote:
>> Since mem_cgroup_recursive_stat(root_mem_cgroup, INDEX) will sum up
>> all memcg stats without regard to root's use_hierarchy, we may use
>> global stats instead for simplicity.
>>
>> Signed-off-by: Sha Zhengju <handai.szj@xxxxxxxxxx>
>> ---
>>   mm/memcontrol.c |    6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
>> index 669d16a..735cd41 100644
>> --- a/mm/memcontrol.c
>> +++ b/mm/memcontrol.c
>> @@ -4987,11 +4987,11 @@ static inline u64 mem_cgroup_usage(struct mem_cgroup *memcg, bool swap)
>>                       return res_counter_read_u64(&memcg->memsw, RES_USAGE);
>>       }
>>
>> -     val = mem_cgroup_recursive_stat(memcg, MEM_CGROUP_STAT_CACHE);
>> -     val += mem_cgroup_recursive_stat(memcg, MEM_CGROUP_STAT_RSS);
>> +     val = global_page_state(NR_FILE_PAGES);
>> +     val += global_page_state(NR_ANON_PAGES);
>>
> you missed NR_ANON_TRANSPARENT_HUGEPAGES
right..

>
>>       if (swap)
>> -             val += mem_cgroup_recursive_stat(memcg, MEM_CGROUP_STAT_SWAP);
>> +             val += total_swap_pages - atomic_long_read(&nr_swap_pages);
>>
> Double count mapped SwapCache ? Did you saw Costa's trial in a week ago ?

yeah, I’m hesitating how to handle swapcache. I've replied in that thread.  : )


Thanks,
Sha

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]