From: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Zhu Yanhai <zhu.yanhai@gmail.com>
Cc: Andre Nathan <andre@digirati.com.br>,
linux-kernel@vger.kernel.org, balbir@linux.vnet.ibm.com
Subject: Re: About cgroup memory limits
Date: Fri, 25 May 2012 13:58:15 +0900 [thread overview]
Message-ID: <4FBF1167.6010607@jp.fujitsu.com> (raw)
In-Reply-To: <CAC8teKXWuzANxCVuV1c+A4Qyh5i7Ws=H5=f-oph72Di_XJFdAQ@mail.gmail.com>
(2012/05/25 13:16), Zhu Yanhai wrote:
> 2012/5/10 KAMEZAWA Hiroyuki<kamezawa.hiroyu@jp.fujitsu.com>:
>> (2012/05/10 3:37), Andre Nathan wrote:
>>
>>> Hello
>>>
>>> I'm doing some tests with LXC and how it interacts with the memory
>>> cgroup limits, more specifically the memory.limit_in_bytes control file.
>>>
>>> Am I correct in my understanding of the memory cgroup documentation[1]
>>> that the limit set in memory.limit_in_bytes is applied to the sum of the
>>> fields 'cache', 'rss' and 'mapped_file' in the memory.stat file?
>>>
>>
>> cache includes mapped_file. Then,
>
> Excuse me, but it does read:
>
> switch (ctype) {
> case MEM_CGROUP_CHARGE_TYPE_CACHE:
> case MEM_CGROUP_CHARGE_TYPE_SHMEM:
> SetPageCgroupCache(pc);
> SetPageCgroupUsed(pc);
> break;
> case MEM_CGROUP_CHARGE_TYPE_MAPPED:
> ClearPageCgroupCache(pc);
> SetPageCgroupUsed(pc);
> break;
> default:
> break;
> }
> mem_cgroup_charge_statistics(mem, pc, page_size);
>
> And then, in mem_cgroup_charge_statistics() we have :
>
> if (PageCgroupCache(pc))
> __mem_cgroup_stat_add_safe(cpustat,
> MEM_CGROUP_STAT_CACHE, numpages);
> else
> __mem_cgroup_stat_add_safe(cpustat, MEM_CGROUP_STAT_RSS,
> numpages);
>
> So it seems that rss includes mapped_file, not cache?
>
Why you think so ? mapped_file is mapped file cache. All file caches
are accountned as STAT_CACHE.
TYPE_MAPPDED doesn't mean mapped_file.
In above, TYPE_MAPPED is called via anonymous page fault.
It represents anonymous page, counted as RSS.
I wonder it may be better to rename these macros.
Thanks,
-Kame
next prev parent reply other threads:[~2012-05-25 5:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-09 18:37 About cgroup memory limits Andre Nathan
2012-05-10 9:47 ` KAMEZAWA Hiroyuki
2012-05-10 10:55 ` Andre Nathan
2012-05-11 0:30 ` KAMEZAWA Hiroyuki
2012-05-25 4:16 ` Zhu Yanhai
2012-05-25 4:58 ` Kamezawa Hiroyuki [this message]
2012-05-25 6:11 ` Zhu Yanhai
[not found] ` <CAKTCnz=0vihGLXQx+C_9399018eJ1hfRHUk21fE=2i_emLzBAw@mail.gmail.com>
2012-05-15 11:07 ` Balbir Singh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FBF1167.6010607@jp.fujitsu.com \
--to=kamezawa.hiroyu@jp.fujitsu.com \
--cc=andre@digirati.com.br \
--cc=balbir@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=zhu.yanhai@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox