Process scheduling changes - adapted from FreeBSD 1.1.5. Basically,
charge scheduling CPU of child process to the parent and have child inherit scheduling CPU from parent on fork. Makes a **big** difference in the feel of the system to interactive users. Submitted by: John Dyson
This commit is contained in:
parent
ee4834308a
commit
0d2afceedd
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)kern_exit.c 8.7 (Berkeley) 2/12/94
|
||||
* $Id$
|
||||
* $Id: kern_exit.c,v 1.3 1994/08/02 07:41:59 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -358,6 +358,10 @@ wait1(q, uap, retval)
|
||||
continue;
|
||||
nfound++;
|
||||
if (p->p_stat == SZOMB) {
|
||||
/* charge childs scheduling cpu usage to parent */
|
||||
if( curproc->p_pid != 1)
|
||||
curproc->p_estcpu += p->p_estcpu;
|
||||
|
||||
retval[0] = p->p_pid;
|
||||
#ifdef COMPAT_43
|
||||
if (uap->compat)
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)kern_fork.c 8.6 (Berkeley) 4/8/94
|
||||
* $Id$
|
||||
* $Id: kern_fork.c,v 1.3 1994/08/02 07:42:00 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -261,11 +261,17 @@ fork1(p1, isvfork, retval)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* set priority of child to be that of parent
|
||||
*/
|
||||
p2->p_estcpu = p1->p_estcpu;
|
||||
|
||||
/*
|
||||
* This begins the section where we must prevent the parent
|
||||
* from being swapped.
|
||||
*/
|
||||
p1->p_flag |= P_NOSWAP;
|
||||
|
||||
/*
|
||||
* Set return values for child before vm_fork,
|
||||
* so they can be copied to child stack.
|
||||
|
Loading…
Reference in New Issue
Block a user