Subject: Re: Speeding up fork/wait path
To: David Laight <david@l8s.co.uk>
From: Jaromir Dolecek <jdolecek@NetBSD.org>
List: tech-kern
Date: 11/06/2003 10:38:40
David Laight wrote:
> On Thu, Nov 06, 2003 at 09:13:21AM +0100, Jaromir Dolecek wrote:
> > Note KERNEL_PROC_LOCK() is held until lwp_exit2() is called.
> 
> yes - but someday the 'big lock' will get killed.

Besides that - the stack is not released until _after_ the kernel
switches away from the exiting process stack to idle context. So
there is no problem even if there would not be any kernel lock
at all.

Basically the only reason why I keep the KERNEL_PROC_LOCK on exit
path is that the exiting LWP might need the associated process
context during exit path before LWP's decomissioned (basically
until lwp_exit2() is called), so we need to prevent exit-vs-wait
race. (Prevent parent to collect the zombie process before we stop
needing the process context).

> IMHO We ought not to be writing new stuff that relies heavily on it.
> 
> 	David
> 
> -- 
> David Laight: david@l8s.co.uk
> 

-- 
Jaromir Dolecek <jdolecek@NetBSD.org>            http://www.NetBSD.cz/
-=- We should be mindful of the potential goal, but as the Buddhist -=-
-=- masters say, ``You may notice during meditation that you        -=-
-=- sometimes levitate or glow.   Do not let this distract you.''   -=-