Subject: Re: scheduler_wait_hook
To: YAMAMOTO Takashi <email@example.com>
From: David Laight <firstname.lastname@example.org>
Date: 10/06/2005 21:15:40
On Thu, Oct 06, 2005 at 04:24:38PM +0900, YAMAMOTO Takashi wrote:
> currently, scheduler_fork_hook copies parent's p_estcpu to child.
> and scheduler_wait_hook adds it back to the parent.
> it effectively doubles parent's p_estcpu and make some applications
> (eg. my login script ;-) unreasonablly slow on cpu-loaded machines.
I can't remember whether NetBSD fork() returns in the child of parent first.
Often the child runs first because it is expected to do an exec() next,
and that (hopefully) reduces the number of 'copy-on-write' faults.
However this leaves the parent process sleeping as an active process so
that its priority get killed.
If that is happening, then adding a short delay in the child (eg poll(0,0,1))
when it returns from fork() can let the parent run and get back to its
main blocking point. Then the parents priority stays sane.
David Laight: email@example.com