Re: [rfc] do not place sub-threads on task_struct->children list

From: Oleg Nesterov
Date: Wed Jul 01 2009 - 01:43:52 EST


On 06/30, Roland McGrath wrote:
>
> > Currently we add sub-threads to ->real_parent->children list. This
> > buys nothing but slows down do_wait().
> >
> > With this patch ->children contains only main threads (group leaders).
> > The only complication is that forget_original_parent() should iterate
> > over sub-threads by hand.
>
> This seems right to me, though I'll admit I haven't really walked through
> all the exit/reparent paths afresh with this in mind.
>
> Note that this naturally suggests moving ->sibling to signal_struct. (Of
> course that can come later.) The abuse of sibling in reparent_leader adds
> a wrinkle to that, but off hand it looks like it could do the same with it
> living in signal_struct with a bit of contortion.

Yes, this change was suggested a long ago.

But in that case forget_original_parent() still has to iterate over all childs
to send ->pdeath_signal and change ->real_parent when we reparent to sub-thread.

> Oh, and what about the de_thread() leader-replacement case?

Ah, good point!

de_thread() should do list_replace_init().

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/