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>,
Andrew Morton <akpm@linux-foundation.org>,
"linux-mm@kvack.org" <linux-mm@kvack.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: Low overhead patches for the memory cgroup controller (v3)
Date: Fri, 5 Jun 2009 17:47:21 +0800 [thread overview]
Message-ID: <20090605094721.GK11755@balbir.in.ibm.com> (raw)
In-Reply-To: <20090605150527.c263037c.nishimura@mxp.nes.nec.co.jp>
* nishimura@mxp.nes.nec.co.jp <nishimura@mxp.nes.nec.co.jp> [2009-06-05 15:05:27]:
> Hmm.. I can't see any practical changes from v2 except for PCG_ACCT -> PCG_ACCT_LRU.
>
> > @@ -1107,9 +1118,24 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *mem,
> > css_put(&mem->css);
> > return;
> > }
> > +
> > pc->mem_cgroup = mem;
> > smp_wmb();
> > - pc->flags = pcg_default_flags[ctype];
> > + 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:
> > + SetPageCgroupUsed(pc);
> I think we need ClearPageCgroupCache() here.
> Otherwise, we cannot trust PageCgroupCache() in mem_cgroup_charge_statistics().
> A page can be reused, but we don't cleare PCG_CACHE on free/alloc of page.
Yes, I know, I think it is best to set pc->flags to 0 before setting
the bits. Thanks!
>
> > + break;
> > + default:
> > + break;
> > + }
> > +
> > + if (mem == root_mem_cgroup)
> > + SetPageCgroupRoot(pc);
> >
> I think you should set PCG_ROOT before setting PCG_USED.
> IIUC, PCG_ROOT bit must be visible already when PCG_USED is set.
Kame pointed to something similar, I am going to remove PCG_ROOT in
the next version.
--
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-05 9:47 UTC|newest]
Thread overview: 30+ 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 [this message]
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
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=20090605094721.GK11755@balbir.in.ibm.com \
--to=balbir@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--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