Subject: scheduler_wait_hook
To: None <tech-kern@netbsd.org>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 10/06/2005 16:24:38
hi,

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.

if no one objects, i'll commit the following patch.

YAMAMOTO Takashi

Index: kern/kern_synch.c
===================================================================
--- kern/kern_synch.c	(revision 1390)
+++ kern/kern_synch.c	(working copy)
@@ -1215,7 +1215,9 @@ scheduler_wait_hook(struct proc *parent,
 {
 
 	/* XXX Only if parent != init?? */
-	parent->p_estcpu = ESTCPULIM(parent->p_estcpu + child->p_estcpu);
+	if (parent->p_estcpu < child->p_estcpu) {
+		parent->p_estcpu = child->p_estcpu;
+	}
 }
 
 /*