diff options
author | dg <dg@FreeBSD.org> | 1994-08-06 07:15:04 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1994-08-06 07:15:04 +0000 |
commit | 9719140bdfe07aea5f217adac3c4f94791677243 (patch) | |
tree | ec590a0ed15a5a1bd1d79a40e505550cd77efc3e | |
parent | 85b36e9dfa3cfc5ec0c04a26b456afa7f844fd29 (diff) | |
download | FreeBSD-src-9719140bdfe07aea5f217adac3c4f94791677243.zip FreeBSD-src-9719140bdfe07aea5f217adac3c4f94791677243.tar.gz |
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
-rw-r--r-- | sys/kern/kern_exit.c | 6 | ||||
-rw-r--r-- | sys/kern/kern_fork.c | 8 |
2 files changed, 12 insertions, 2 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 0a0ac8f..b93a656 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -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 @@ loop: 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) diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index a415fc0..e0362e9 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -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> @@ -262,10 +262,16 @@ again: #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. |