OpenVZ Forum


Home » Mailing lists » Devel » [PATCH] Use struct pid parameter in copy_process()
Re: [PATCH] Use struct pid parameter in copy_process() [message #17527 is a reply to message #17526] Sat, 24 February 2007 03:29 Go to previous message
ebiederm is currently offline  ebiederm
Messages: 1354
Registered: February 2006
Senior Member
sukadev@us.ibm.com 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@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: [PATCH] ecryptfs: handles AOP_TRUNCATED_PAGE better
Next Topic: [RFC][PATCH][0/4] Memory controller (RSS Control) (
Goto Forum:
  


Current Time: Sat Aug 16 17:26:17 GMT 2025

Total time taken to generate the page: 0.39329 seconds