summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_fork.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2007-09-17 05:31:39 +0000
committerjeff <jeff@FreeBSD.org>2007-09-17 05:31:39 +0000
commit3fc0f8b973fdc2f392a3234d653e09d71e2aab98 (patch)
treee572a7b77f24339d2dc6ebf6b83c1e2c1ce0f6a5 /sys/kern/kern_fork.c
parent74666fdfce0e06484d5f82e8fced0c16c06477d1 (diff)
downloadFreeBSD-src-3fc0f8b973fdc2f392a3234d653e09d71e2aab98.zip
FreeBSD-src-3fc0f8b973fdc2f392a3234d653e09d71e2aab98.tar.gz
- Move all of the PS_ flags into either p_flag or td_flags.
- p_sflag was mostly protected by PROC_LOCK rather than the PROC_SLOCK or previously the sched_lock. These bugs have existed for some time. - Allow swapout to try each thread in a process individually and then swapin the whole process if any of these fail. This allows us to move most scheduler related swap flags into td_flags. - Keep ki_sflag for backwards compat but change all in source tools to use the new and more correct location of P_INMEM. Reported by: pho Reviewed by: attilio, kib Approved by: re (kensmith)
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r--sys/kern/kern_fork.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 1a7f4a7..f8fc9de 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -493,17 +493,15 @@ again:
td2->td_sigstk = td->td_sigstk;
td2->td_sigmask = td->td_sigmask;
+ td2->td_flags = TDF_INMEM;
/*
* Duplicate sub-structures as needed.
* Increase reference counts on shared objects.
*/
- p2->p_flag = 0;
+ p2->p_flag = P_INMEM;
if (p1->p_flag & P_PROFIL)
startprofclock(p2);
- PROC_SLOCK(p2);
- p2->p_sflag = PS_INMEM;
- PROC_SUNLOCK(p2);
td2->td_ucred = crhold(p2->p_ucred);
pargs_hold(p2->p_args);
OpenPOWER on IntegriCloud