From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Andrew Morton <akpm@linux-foundation.org>,
Balbir Singh <bsingharora@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] memcg: drain all stocks for the cgroup before read usage
Date: Thu, 8 Sep 2011 00:33:40 +0300 [thread overview]
Message-ID: <20110907213340.GA7690@shutemov.name> (raw)
In-Reply-To: <20110905101607.cd946a46.nishimura@mxp.nes.nec.co.jp>
On Mon, Sep 05, 2011 at 10:16:07AM +0900, Daisuke Nishimura wrote:
> On Mon, 5 Sep 2011 08:59:13 +0900
> KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
>
> > On Sun, 4 Sep 2011 04:15:33 +0300
> > "Kirill A. Shutemov" <kirill@shutemov.name> wrote:
> >
> > > From: "Kirill A. Shutemov" <kirill@shutemov.name>
> > >
> > > Currently, mem_cgroup_usage() for non-root cgroup returns usage
> > > including stocks.
> > >
> > > Let's drain all socks before read resource counter value. It makes
> > > memory{,.memcg}.usage_in_bytes and memory.stat consistent.
> > >
> > > Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
> >
> > Hmm. This seems costly to me.
> >
> > If a user chesk usage_in_bytes in a memcg once per 1sec,
> > the kernel will call schedule_work on cpus once per 1sec.
> > So, IMHO, I don't like this.
> >
> I agree.
>
> We discussed a similar topic on the thread https://lkml.org/lkml/2011/3/18/212.
> And, we added the memory.txt:
> ---
> 5.5 usage_in_bytes
>
> For efficiency, as other kernel components, memory cgroup uses some optimization
> to avoid unnecessary cacheline false sharing. usage_in_bytes is affected by the
> method and doesn't show 'exact' value of memory(and swap) usage, it's an fuzz
> value for efficient access. (Of course, when necessary, it's synchronized.)
> If you want to know more exact memory usage, you should use RSS+CACHE(+SWAP)
> value in memory.stat(see 5.2).
> ---
Agree, thanks.
Should we have field 'ram' (or 'memory') for rss+cache in memory.stat?
--
Kirill A. Shutemov
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-09-07 21:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-04 1:15 [PATCH] memcg: drain all stocks for the cgroup before read usage Kirill A. Shutemov
2011-09-04 7:20 ` Paul Menage
2011-09-04 23:59 ` KAMEZAWA Hiroyuki
2011-09-05 1:16 ` Daisuke Nishimura
2011-09-07 21:33 ` Kirill A. Shutemov [this message]
2011-09-08 0:19 ` KAMEZAWA Hiroyuki
2011-09-08 0:49 ` Kirill A. Shutemov
2011-09-08 9:21 ` KAMEZAWA Hiroyuki
2011-09-08 10:09 ` Johannes Weiner
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=20110907213340.GA7690@shutemov.name \
--to=kirill@shutemov.name \
--cc=akpm@linux-foundation.org \
--cc=bsingharora@gmail.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nishimura@mxp.nes.nec.co.jp \
/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).