summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-03-12 17:49:38 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-03-12 17:49:38 +0000
commit54bc7f013030e60ef0e9fa59e04552941cc2eca0 (patch)
tree0ee8348f9c2c2cc2bc5f2c3e8205e5204d253679 /sys
parentd2d8dfb1c25027fe4dd7a302e4fef93becc6e9e9 (diff)
in scheduler, bias parents for child cpu usage; ross@ghs.com
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_exit.c6
-rw-r--r--sys/kern/kern_fork.c9
2 files changed, 13 insertions, 2 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 245e6c62015..e12833d2947 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exit.c,v 1.16 1999/03/02 22:19:09 niklas Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.17 1999/03/12 17:49:37 deraadt Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
@@ -368,6 +368,10 @@ loop:
wakeup((caddr_t)t);
return (0);
}
+
+ /* Charge us for our child's sins */
+ curproc->p_estcpu = min(curproc->p_estcpu +
+ p->p_estcpu, UCHAR_MAX);
p->p_xstat = 0;
ruadd(&q->p_stats->p_cru, p->p_ru);
FREE(p->p_ru, M_ZOMBIE);
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 55cf72ce782..75e138eb8ca 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_fork.c,v 1.19 1999/03/02 22:19:08 niklas Exp $ */
+/* $OpenBSD: kern_fork.c,v 1.20 1999/03/12 17:49:37 deraadt Exp $ */
/* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */
/*
@@ -298,6 +298,13 @@ again:
#endif
/*
+ * set priority of child to be that of parent
+ * XXX should move p_estcpu into the region of struct proc which gets
+ * copied.
+ */
+ p2->p_estcpu = p1->p_estcpu;
+
+ /*
* This begins the section where we must prevent the parent
* from being swapped.
*/