Subject: Re: more on exit performance
To: David Laight <david@l8s.co.uk>
From: Jaromir Dolecek <jdolecek@NetBSD.org>
List: tech-perform
Date: 11/05/2003 14:18:04
David Laight wrote:
> > find_stopped_child() walks a linked-list of the proc's children.
> > there are several ways to improve this:
> > 
> >  (2) for (pid == -1), we can keep the stopped and dead children on
> >      separate lists, and only look at the list(s) that we care about.
> 
> The p_sibling list isn't used (much) so having a second list of
> children in state SSTOP/SZOMB linking through p_sibling, but
> with a different head is a possibility.
> 
> The only difficulty is kern_ktrace.c:ktrsetchildren which is carefully
> non-recursive at the moment.
> I don't think it is possible to traverse two sibling lists no-recursively!

One thing which occurred to me too:

we need to optimize both the case when there _is_ a zombie or
stopped child (i.e. do fast lookup) and the case where isn't
(avoid scanning the list if there is no waiting child).

Looking at zombproc list would help with the former, but not
with the latter.

Jaromir
-- 
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.''   -=-