Re: [PATCH] Use struct pid parameter in copy_process()

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

 



sukadev@xxxxxxxxxx writes:

> Yes. I can break that up into two patches, but I missed and Badari
> pointed the other caller to copy_process()
>
> struct task_struct * __cpuinit fork_idle(int cpu)
> {
>         struct task_struct *task;
>         struct pt_regs regs;
>
>         task = copy_process(CLONE_VM, 0, idle_regs(&regs), 0, NULL, NULL, 0);
>         if (!IS_ERR(task))
>                 init_idle(task, cpu);
>
>         return task;
> }
>
> Now this is passing a null struct pid which would not be good 
> if I remove the if (likely(p->pid)) check in copy_process().
>
> Does this copy_process() mean there can be multiple tasks with
> pid_t == 0 (one per cpu on an SMP system) ?

Yes.  The idle processes.

> Can we simply attach all those tasks to init_struct_pid by passing
> in &init_struct_pid to the above copy_process() ?

Yes.

Eric
_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxx
https://lists.osdl.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