Re: About cgroup memory limits

From: KAMEZAWA Hiroyuki
Date: Thu May 10 2012 - 20:32:54 EST


(2012/05/10 19:55), Andre Nathan wrote:

> Thanks a lot Kame.
>
> On Thu, 2012-05-10 at 18:47 +0900, KAMEZAWA Hiroyuki wrote:
>> From above, rss + mapped_file == resident.
>
> But if you check the numbers I get from memory.stat and the sum of the
> statm fields for all container processes, this doesn't hold.
>
> resident = 28741632
> rss = 8192000
> mapped_file = 3743744
>
> Am I missing something here?
>

Considering again...

file_mapped is accounted into the memcg where it's accounted as 'cache' to.

So, you can know 'mapped_file/caches ratio' but you can't know which cgroup
maps it.

> size resident share text lib data dt
> 897208320 28741632 20500480 1171456 0 170676224 0
>

resident - share = anon.

28741632 - 20500480 = 8241152 (anon) near value to rss.

About file_mapped, 3743744(mapped_file) * 100 /20500480(shared) = 18 %

18% of your app's file-mapping may be accounted into the memcg.

You may be able to different score if you do all test after drop-cache.
echo 3 > /proc/sys/vm/drop_caches

Thanks,
-Kame




--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/