All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: Paul Menage <menage@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	containers@lists.linux-foundation.org
Subject: Re: [PATCH -mm 2/3] cgroup: simplify init_subsys()
Date: Thu, 03 Apr 2008 12:59:34 +0800	[thread overview]
Message-ID: <47F46436.3060607@cn.fujitsu.com> (raw)
In-Reply-To: <6599ad830804020326o7947e3e5k25249e6b1c00e6b5@mail.gmail.com>

Paul Menage wrote:
> On Tue, Apr 1, 2008 at 7:16 PM, Li Zefan <lizf@cn.fujitsu.com> wrote:
>>  -
>>  -       /* If this subsystem requested that it be notified with fork
>>  -        * events, we should send it one now for every process in the
>>  -        * system */
>>  -       if (ss->fork) {
>>  -               struct task_struct *g, *p;
>>  -
>>  -               read_lock(&tasklist_lock);
>>  -               do_each_thread(g, p) {
>>  -                       ss->fork(ss, p);
>>  -               } while_each_thread(g, p);
>>  -               read_unlock(&tasklist_lock);
>>  -       }
> 
> Should we maybe call ss->fork(ss, &init_task) ? Or just document that
> ss->fork() explicitly doesn't get called for init.
> 
> Maybe also add some BUG()s to confirm that no other tasks have in fact
> been forked by this point?
> 

At system boot, before all the subsystems have been registered, no processes
including init has been forked, am I right? So the fork callback will be
invoked when the init process is forked, so we don't need to call
ss->fork(ss, &init_task).

I'll add a BUG_ON(), and update the document about the fork callback.

Regards,
Li Zefan

  reply	other threads:[~2008-04-03  5:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-02  2:16 [PATCH -mm 2/3] cgroup: simplify init_subsys() Li Zefan
     [not found] ` <47F2EC94.8030707-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2008-04-02 10:26   ` Paul Menage
2008-04-02 10:26 ` Paul Menage
2008-04-03  4:59   ` Li Zefan [this message]
     [not found]   ` <6599ad830804020326o7947e3e5k25249e6b1c00e6b5-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-04-03  4:59     ` Li Zefan
  -- strict thread matches above, loose matches on Subject: below --
2008-04-02  2:16 Li Zefan
2008-04-03  5:53 Li Zefan
2008-04-03  5:53 Li Zefan
     [not found] ` <47F470BF.3060905-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2008-04-03 17:41   ` Paul Menage
2008-04-03 17:41 ` Paul Menage

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=47F46436.3060607@cn.fujitsu.com \
    --to=lizf@cn.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=containers@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=menage@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.