[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100825085843.54277f3c.kamezawa.hiroyu@jp.fujitsu.com>
Date: Wed, 25 Aug 2010 08:58:43 +0900
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To: Li Zefan <lizf@...fujitsu.com>
Cc: linux-mm@...ck.org,
"nishimura@....nes.nec.co.jp" <nishimura@....nes.nec.co.jp>,
"balbir@...ux.vnet.ibm.com" <balbir@...ux.vnet.ibm.com>,
gthelen@...gle.com, m-ikeda@...jp.nec.com,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
kamezawa.hiroyuki@...il.com,
"menage@...gle.com" <menage@...gle.com>
Subject: Re: [PATCH 1/5] cgroup: ID notification call back
On Tue, 24 Aug 2010 17:04:52 +0800
Li Zefan <lizf@...fujitsu.com> wrote:
> KAMEZAWA Hiroyuki wrote:
> > CC'ed to Paul Menage and Li Zefan.
> > ==
> > From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
> >
> > When cgroup subsystem use ID (ss->use_id==1), each css's ID is assigned
> > after successful call of ->create(). css_ID is tightly coupled with
> > css struct itself but it is allocated by ->create() call, IOW,
> > per-subsystem special allocations.
> >
> > To know css_id before creation, this patch adds id_attached() callback.
> > after css_ID allocation. This will be used by memory cgroup's quick lookup
> > routine.
> >
> > Maybe you can think of other implementations as
> > - pass ID to ->create()
> > or
> > - add post_create()
> > etc...
> > But when considering dirtiness of codes, this straightforward patch seems
> > good to me. If someone wants post_create(), this patch can be replaced.
> >
> > Changelog: 20100820
> > - new approarch.
> >
> > Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
>
> Acked-by: Li Zefan <lizf@...fujitsu.com>
>
> ...
> >
> > Index: mmotm-0811/include/linux/cgroup.h
> > ===================================================================
> > --- mmotm-0811.orig/include/linux/cgroup.h
> > +++ mmotm-0811/include/linux/cgroup.h
> > @@ -475,6 +475,7 @@ struct cgroup_subsys {
> > struct cgroup *cgrp);
> > void (*post_clone)(struct cgroup_subsys *ss, struct cgroup *cgrp);
> > void (*bind)(struct cgroup_subsys *ss, struct cgroup *root);
> > + void (*id_attached)(struct cgroup_subsys *ss, struct cgroup *cgrp);
>
> Maybe pass the id number to id_attached() is better.
>
ok.
> And actually the @ss argument is not necessary, because the memcg's
> id_attached() handler of course knows it's dealing with the memory
> cgroup subsystem.
>
> So I suspect we can just remove all the @ss from all the callbacks..
>
I agree. But could you write "remove ss" patch later ?
It seems an design change. I leave "ss" as this for now.
Thanks
-Kame
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists