aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_fork.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r--sys/kern/kern_fork.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 0af883b8e476..9c2169a713e0 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -53,6 +53,7 @@
#include <sys/proc.h>
#include <sys/pioctl.h>
#include <sys/resourcevar.h>
+#include <sys/sched.h>
#include <sys/syscall.h>
#include <sys/vnode.h>
#include <sys/acct.h>
@@ -515,6 +516,12 @@ again:
p2->p_sflag = PS_INMEM;
if (p1->p_sflag & PS_PROFIL)
startprofclock(p2);
+ /*
+ * Allow the scheduler to adjust the priority of the child and
+ * parent while we hold the sched_lock.
+ */
+ sched_fork(td->td_ksegrp, kg2);
+
mtx_unlock_spin(&sched_lock);
p2->p_ucred = crhold(td->td_ucred);
td2->td_ucred = crhold(p2->p_ucred); /* XXXKSE */
@@ -635,12 +642,6 @@ again:
}
/*
- * set priority of child to be that of parent.
- * XXXKSE this needs redefining..
- */
- kg2->kg_estcpu = td->td_ksegrp->kg_estcpu;
-
- /*
* This begins the section where we must prevent the parent
* from being swapped.
*/