Re: [PATCH -mm 2/3] cgroup: simplify init_subsys()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Paul Menage wrote:
> On Tue, Apr 1, 2008 at 7:16 PM, Li Zefan <lizf@xxxxxxxxxxxxxx> 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
_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers

[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux