From: Balbir Singh <balbir@linux.vnet.ibm.com>
To: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
"lizf@cn.fujitsu.com" <lizf@cn.fujitsu.com>,
"menage@google.com" <menage@google.com>,
KOSAKI Motohiro <m-kosaki@ceres.dti.ne.jp>
Subject: Re: [RFC] Low overhead patches for the memory cgroup controller (v2)
Date: Mon, 1 Jun 2009 13:49:40 +0800 [thread overview]
Message-ID: <20090601054940.GB6120@balbir.in.ibm.com> (raw)
In-Reply-To: <20090601132505.2fe9c870.nishimura@mxp.nes.nec.co.jp>
* nishimura@mxp.nes.nec.co.jp <nishimura@mxp.nes.nec.co.jp> [2009-06-01 13:25:05]:
> I'm sorry for my very late reply.
>
> I've been working on the stale swap cache problem for a long time as you know :)
>
> On Sun, 17 May 2009 12:15:43 +0800, Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
> > * KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> [2009-05-16 02:45:03]:
> >
> > > I think set/clear flag here adds race condtion....because pc->flags is
> > > modfied by
> > > pc->flags = pcg_dafault_flags[ctype] in commit_charge()
> > > you have to modify above lines to be
> > >
> > > SetPageCgroupCache(pc) or some..
> > > ...
> > > SetPageCgroupUsed(pc)
> > >
> > > Then, you can use set_bit() without lock_page_cgroup().
> > > (Currently, pc->flags is modified only under lock_page_cgroup(), so,
> > > non atomic code is used.)
> > >
> >
> > Here is the next version of the patch
> >
> >
> > Feature: Remove the overhead associated with the root cgroup
> >
> > From: Balbir Singh <balbir@linux.vnet.ibm.com>
> >
> > This patch changes the memory cgroup and removes the overhead associated
> > with accounting all pages in the root cgroup. As a side-effect, we can
> > no longer set a memory hard limit in the root cgroup.
> >
> I agree to this idea itself.
>
Thanks!
> > A new flag is used to track page_cgroup associated with the root cgroup
> > pages. A new flag to track whether the page has been accounted or not
> > has been added as well. Flags are now set atomically for page_cgroup,
> > pcg_default_flags is now obsolete, but I've not removed it yet. It
> > provides some readability to help the code.
> >
> > Tests:
> > 1. Tested lightly, previous versions showed good performance improvement 10%.
> >
> You should test current version :)
> And I think you should test this patch under global memory pressure too
> to check whether it doesn't cause bug or under/over flow of something, etc.
> memcg's LRU handling about SwapCache is different from usual one.
>
OK, I've tested it using my stress tool, but I'll modify to add some
of the things you've pointed out.
> > NOTE:
> > I haven't got the time right now to run oprofile and get detailed test results,
> > since I am in the middle of travel.
> >
> > Please review the code for functional correctness and if you can test
> > it even better. I would like to push this in, especially if the %
> > performance difference I am seeing is reproducible elsewhere as well.
> >
> > Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
> > ---
> >
> > include/linux/page_cgroup.h | 12 ++++++++++++
> > mm/memcontrol.c | 42 ++++++++++++++++++++++++++++++++++++++----
> > mm/page_cgroup.c | 1 -
> > 3 files changed, 50 insertions(+), 5 deletions(-)
> >
> >
> > diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
> > index 7339c7b..ebdae9a 100644
> > --- a/include/linux/page_cgroup.h
> > +++ b/include/linux/page_cgroup.h
> > @@ -26,6 +26,8 @@ enum {
> > PCG_LOCK, /* page cgroup is locked */
> > PCG_CACHE, /* charged as cache */
> > PCG_USED, /* this object is in use. */
> > + PCG_ROOT, /* page belongs to root cgroup */
> > + PCG_ACCT, /* page has been accounted for */
> > };
> >
> Those new flags are protected by zone->lru_lock, right ?
> If so, please add some comments.
> And I'm not sure why you need 2 flags. Isn't PCG_ROOT enough for you ?
>
Nope.. the accounting is independent of charge/uncharge.
--
Balbir
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2009-06-01 5:49 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-15 17:45 [RFC] Low overhead patches for the memory cgroup controller (v2) KAMEZAWA Hiroyuki
2009-05-15 18:16 ` Balbir Singh
2009-05-18 10:11 ` KAMEZAWA Hiroyuki
2009-05-18 10:45 ` Balbir Singh
2009-05-18 16:01 ` KAMEZAWA Hiroyuki
2009-05-19 13:18 ` Balbir Singh
2009-05-31 23:51 ` Balbir Singh
2009-06-01 23:57 ` KAMEZAWA Hiroyuki
2009-06-05 5:31 ` Low overhead patches for the memory cgroup controller (v3) Balbir Singh
2009-06-05 5:51 ` KAMEZAWA Hiroyuki
2009-06-05 9:33 ` Balbir Singh
2009-06-08 0:20 ` Daisuke Nishimura
2009-06-05 6:05 ` Daisuke Nishimura
2009-06-05 9:47 ` Balbir Singh
2009-06-08 0:03 ` Daisuke Nishimura
2009-06-05 6:43 ` Daisuke Nishimura
2009-06-14 18:37 ` Low overhead patches for the memory cgroup controller (v4) Balbir Singh
2009-06-15 2:04 ` KAMEZAWA Hiroyuki
2009-06-15 2:18 ` Daisuke Nishimura
2009-06-15 2:23 ` KAMEZAWA Hiroyuki
2009-06-15 2:44 ` Balbir Singh
2009-06-15 3:00 ` Balbir Singh
2009-06-15 3:09 ` Daisuke Nishimura
2009-06-15 3:22 ` Balbir Singh
2009-06-15 3:46 ` Daisuke Nishimura
2009-06-15 4:22 ` Balbir Singh
2009-05-17 4:15 ` [RFC] Low overhead patches for the memory cgroup controller (v2) Balbir Singh
2009-06-01 4:25 ` Daisuke Nishimura
2009-06-01 5:01 ` Daisuke Nishimura
2009-06-01 5:49 ` Balbir Singh [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-05-15 15:18 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=20090601054940.GB6120@balbir.in.ibm.com \
--to=balbir@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lizf@cn.fujitsu.com \
--cc=m-kosaki@ceres.dti.ne.jp \
--cc=menage@google.com \
--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).