From: Balbir Singh <balbir@linux.vnet.ibm.com>
To: Paul Menage <menage@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Dhaval Giani <dhaval@linux.vnet.ibm.com>,
linux-kernel@vger.kernel.org, Balaji Rao <balajirrao@gmail.com>,
containers@lists.osdl.org, vatsa@linux.vnet.ibm.com,
a.p.zijlstra@chello.nl
Subject: Re: [-mm] CPU controller statistics (v5)
Date: Wed, 11 Jun 2008 14:10:28 +0530 [thread overview]
Message-ID: <484F8F7C.8040009@linux.vnet.ibm.com> (raw)
In-Reply-To: <6599ad830806110132j1b3f899bx57fd3c894fd0c1c6@mail.gmail.com>
Paul Menage wrote:
> On Tue, Jun 3, 2008 at 1:05 PM, Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
>> diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
>> index e155aa7..60a25cb 100644
>> --- a/include/linux/cgroup.h
>> +++ b/include/linux/cgroup.h
>> @@ -293,6 +293,7 @@ int cgroup_is_descendant(const struct cgroup *cgrp);
>> struct cgroup_subsys {
>> struct cgroup_subsys_state *(*create)(struct cgroup_subsys *ss,
>> struct cgroup *cgrp);
>> + void (*initialize)(int early);
>> void (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp);
>> void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp);
>> int (*can_attach)(struct cgroup_subsys *ss,
>> diff --git a/kernel/cgroup.c b/kernel/cgroup.c
>> index 15ac0e1..77569d7 100644
>> --- a/kernel/cgroup.c
>> +++ b/kernel/cgroup.c
>> @@ -2553,6 +2553,9 @@ int __init cgroup_init_early(void)
>>
>> if (ss->early_init)
>> cgroup_init_subsys(ss);
>> +
>> + if (ss->initialize)
>> + ss->initialize(1);
>> }
>> return 0;
>> }
>> @@ -2577,6 +2580,9 @@ int __init cgroup_init(void)
>> struct cgroup_subsys *ss = subsys[i];
>> if (!ss->early_init)
>> cgroup_init_subsys(ss);
>> +
>> + if (ss->initialize)
>> + ss->initialize(0);
>> }
>
> This seems a little weird - even if the subsystem didn't want early
> initialization, we call its initialize() during early setup?
>
> I assume the idea is to move away from the current model where the
> subsystem is expected to initialize itself during the first call to
> its create() method, when it gets passed a cgroup with a NULL parent?
> I agree that was a bit icky. How about we call ss->initialize() from
> cgroup_init_subsys()? Then we wouldn't need the "early" parameter,
> since it would be implicit based on whether the subsystem wanted early
> initialization or not.
>
The motivation was to ensure that kmalloc* calls are available at the time of
ss_initialize
> Also, if you're adding a new subsystem method, you should document it
> in Documentation/cgroups.txt
Thanks for the comments. There were some more things that are wrong with this
patch and Andrew pointed them out. We'll work on a newer vesion.
--
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
prev parent reply other threads:[~2008-06-11 8:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-03 20:05 [-mm] CPU controller statistics (v5) Balbir Singh
2008-06-04 21:44 ` Andrew Morton
2008-06-05 9:37 ` Balbir Singh
2008-06-11 8:28 ` Paul Menage
2008-06-11 8:32 ` Paul Menage
2008-06-11 8:40 ` Balbir Singh [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=484F8F7C.8040009@linux.vnet.ibm.com \
--to=balbir@linux.vnet.ibm.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=balajirrao@gmail.com \
--cc=containers@lists.osdl.org \
--cc=dhaval@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=menage@google.com \
--cc=vatsa@linux.vnet.ibm.com \
/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