Re: init's children list is long and slows reaping children.

Ingo Molnar
2007-04-06T19:43:44Z

* Oleg Nesterov <oleg@tv-sign.ru> wrote:

> > I'd almost prefer to just not add kernel threads to any parent
> > process list *at*all*.
>
> Yes sure, I didn't argue with that. However, "->exit_state = -1" does
> matter, we can't detach process unless we make it auto-reap.

> Off course, we also need to add preparent_to_init() to kthread() and
> (say) stopmachine(). Or we can create kernel_thread_detached() and
> modify callers to use it.

this isnt a kernel-thread special case. The right solution IMO is to
first migrate wait4()'s ->children use over to a new p->exiting_children
list and then to gradually get rid of all remaining uses of p->children.
(the first patch of which i sent a few minutes ago)

that way wait4() will be sped up, and quite dramatically i believe. No
need to deal with kthreads here at all - those just wont ever show up in
the ->exiting_children list. Am i missing something?

Ingo