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 09:13:21
Note KERNEL_PROC_LOCK() is held until lwp_exit2() is called.
Jaromir
David Laight wrote:
> >
> > Exiting process now:
> > 1. pmap_deactivate()s the address space and frees the vmspace
> > 2. runs cpu_wait() (tears down TSS on i386 & amd64)
> > 3. makes the process SZOMB
> > 4. keeps KERNEL_PROC_LOCK()
> >
> > lwp_exit2() now does all post-dead lwp cleanup, including 'freeing' u-area,
> > and unlocks KERNEL_PROC_LOCK() if result of process exit.
> > There is no deadlwp/zomblwp list anymore. uvm_uarea_free() now merely
> > links the 'freed' u-area to a list, it never calls uvm_km_free().
> > exit2() is deleted, lwp_exit2() is always called for either
> > 'lwp' or 'process' exit.
>
> Any thoughts on how to make this properly MP safe?
>
> If nothing else you need to ensure the kernel stack isn't allocated
> to another process until the dying process has been switched out.
>
> You also need to ensure that the parent isn't scheduled/running on
> another cpu and reaps the zombie before you've finished the teardown.
>
> 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.'' -=-