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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Eric W. Biederman
Date: Thursday, April 5, 2007 - 7:15 pm

Linus Torvalds <torvalds@linux-foundation.org> writes:


Right.  pid == 1 being missing might cause some confusing having 
but having ppid == 0 should be fine.  Heck pid == 1 already has 
ppid == 0, so it is a value user space has had to deal with for a
while.

In addition there was a period in 2.6 where most kernel threads
and init had a pgid == 0 and a session  == 0, and nothing seemed
to complain.

We should probably make all of the kernel threads children of
init_task.  The initial idle thread on the first cpu that is the
parent of pid == 1.   That will give the ppid == 0 naturally because
the idle thread has pid == 0.


Almost everything should be using kthread by now.  I do admit that there
are a handful of kernel threads that still use kthread_create but it
is a relatively short list.

Looking we apparently have a couple of process started by
kthread_create that are not under kthread.  They all have  pid numbers
lower than kthread so I'm guessing it is some startup ordering issue.

Currently it looks like daemonize is reparenting everything to init,
changing that to init_task and making the threads self reaping
should be trivial.

.....

I'm a little nervous that we exceeded our default pid max just booting
the kernel.  32768 is a lot of kernel threads.  That sounds like 32
kernel threads per cpu.  That seems to be more than I have on any
of my little machines.


There is no defined order for reaping of child processes and in fact
I can't even see anything in the kernel right now that would even
accidentally give user space the idea we had a defined order.

So I think we have some options once we get the kernel threads out
of the way.  Getting the kernel threads out of the way would seem
to be the first priority.

Eric
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: init's children list is long and slows reaping children., Eric W. Biederman, (Thu Apr 5, 7:15 pm)
Re: init's children list is long and slows reaping children., Eric W. Biederman, (Fri Apr 6, 8:38 am)
Re: init's children list is long and slows reaping children., Eric W. Biederman, (Fri Apr 6, 11:02 am)
Re: init's children list is long and slows reaping children., Eric W. Biederman, (Fri Apr 6, 11:04 am)
Re: init's children list is long and slows reaping children., Christoph Hellwig, (Fri Apr 6, 11:05 am)
Re: init's children list is long and slows reaping children., Eric W. Biederman, (Fri Apr 6, 11:30 am)
Re: init's children list is long and slows reaping children., Eric W. Biederman, (Fri Apr 6, 11:56 am)
Re: init's children list is long and slows reaping children., Eric W. Biederman, (Fri Apr 6, 12:39 pm)
Re: init's children list is long and slows reaping children., Eric W. Biederman, (Mon Apr 9, 1:00 pm)
Re: init's children list is long and slows reaping children., Eric W. Biederman, (Mon Apr 9, 5:48 pm)
Re: init's children list is long and slows reaping children., Alexey Dobriyan, (Mon Apr 9, 10:07 pm)
Re: init's children list is long and slows reaping children., Eric W. Biederman, (Tue Apr 10, 7:51 am)
Re: init's children list is long and slows reaping children., Eric W. Biederman, (Tue Apr 10, 8:00 am)
[PATCH] Only send pdeath_signal when getppid changes., Eric W. Biederman, (Tue Apr 10, 8:16 am)
Re: init's children list is long and slows reaping children., Eric W. Biederman, (Tue Apr 10, 8:22 am)
Re: init's children list is long and slows reaping children., Eric W. Biederman, (Tue Apr 10, 9:17 am)
Re: [PATCH] Only send pdeath_signal when getppid changes., Oleg Nesterov, (Tue Apr 10, 9:37 am)
Re: [PATCH] Only send pdeath_signal when getppid changes., Eric W. Biederman, (Tue Apr 10, 10:41 am)
Re: [PATCH] Only send pdeath_signal when getppid changes., Roland McGrath, (Tue Apr 10, 10:48 am)
Re: init's children list is long and slows reaping children., Davide Libenzi, (Tue Apr 10, 12:17 pm)
Re: [PATCH] Only send pdeath_signal when getppid changes., Albert Cahalan, (Tue Apr 10, 8:17 pm)
[patch] uninline remove/add_parent() APIs, Ingo Molnar, (Tue Apr 10, 11:20 pm)
Re: [patch] uninline remove/add_parent() APIs, Eric W. Biederman, (Wed Apr 11, 12:00 am)
Re: init's children list is long and slows reaping children., Eric W. Biederman, (Wed Apr 11, 1:17 pm)
Re: [patch] uninline remove/add_parent() APIs, Andrew Morton, (Wed Apr 11, 3:06 pm)
Re: [patch] uninline remove/add_parent() APIs, Eric W. Biederman, (Thu Apr 12, 3:45 am)
Re: [patch] uninline remove/add_parent() APIs, Roland McGrath, (Thu Apr 12, 3:50 pm)