cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
To: Michel Machado <michel-K36Kqf6HJK439yzSjRtAkw@public.gmane.org>
Cc: Andre Nathan <andre-K36Kqf6HJK439yzSjRtAkw@public.gmane.org>,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: About cgroup memory limits
Date: Wed, 23 May 2012 10:07:28 +0200	[thread overview]
Message-ID: <20120523080727.GJ1800@cmpxchg.org> (raw)
In-Reply-To: <1337174128.2759.33.camel@Thor>

On Wed, May 16, 2012 at 09:15:28AM -0400, Michel Machado wrote:
> Hi Johannes,
> 
>    Thank you very much for your reply, it does help us to understand the
> numbers we have at hand.
> 
>    Could you clarify your following statement further:
> 
> > > Below is the sum of each field in /proc/$PID/statm for every process
> > > running inside a test container, converted to bytes:
> > > 
> > >        size  resident     share     text  lib       data  dt
> > >   897208320  28741632  20500480  1171456    0  170676224   0
> > 
> > statms accounts based on virtual memory, not physical memory like
> > memcg does.  If you have the same page mapped into two tasks, both
> > their "share" counters will show a page, while the memcg will only
> > account the single physical page in mapped_file.
> 
>    You mean when those two tasks are in the same cgroup, don't you? Is
> there a case in which a page is shared by two tasks that are in
> different cgroups but that page is accounted only for one of the two
> cgroups? If so, how's this case triggered?

It doesn't matter whether it's the same cgroup or separate cgroups.

When two tasks are in separate memory cgroups, the shared page will be
accounted to the group of the task that is responsible for bringing it
into memory, the one touching it for the first time.

      reply	other threads:[~2012-05-23  8:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-10 21:38 About cgroup memory limits Andre Nathan
2012-05-15  9:20 ` Johannes Weiner
     [not found]   ` <20120515092040.GF1406-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2012-05-16 13:15     ` Michel Machado
2012-05-23  8:07       ` Johannes Weiner [this message]

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=20120523080727.GJ1800@cmpxchg.org \
    --to=hannes-druugvl0lcnafugrpc6u6w@public.gmane.org \
    --cc=andre-K36Kqf6HJK439yzSjRtAkw@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=michel-K36Kqf6HJK439yzSjRtAkw@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).