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

Linus Torvalds
2007-04-06T22:51:55Z

On Fri, 6 Apr 2007, Jeff Garzik wrote:
>
> I would rather change the implementation under the hood to start per-CPU
> threads on demand, similar to a thread-pool implementation.
>
> Boxes with $BigNum CPUs probably won't ever use half of those threads.

The counter-argument is that boxes with $BigNum CPU's really don't hurt
from it either, and having per-process data structures is often simpler
and more efficient than trying to have some thread pool.

IOW, once we get the processes off the global list, there just isn't any
downside from them. Sure, they use some memory, but people who buy
1024-cpu machines won't care about a few kB per CPU..

So the *only* downside is literally the process list, and one suggested
patch already just removes kernel threads entirely from the parenthood
lists.

The other potential downside could be "ps is slow", but on the other hand,
having the things stick around and have things like CPU-time accumulate is
probably worth it - if there are some issues, they'd show up properly
accounted for in a way that process pools would have a hard time doing.

So I really don't think this is worth changing things over, apart from
literally removing them from process lists, which I think everybody agrees
we should just do - it just never even came up before!

Linus