aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schultz <das@FreeBSD.org>2004-10-01 05:01:29 +0000
committerDavid Schultz <das@FreeBSD.org>2004-10-01 05:01:29 +0000
commit299bc7367df2e228f4fdb4890b11f99dde9861f0 (patch)
tree0f18ea11b1bf77da8cd270aed4856db2614d81d5
parent616b5f90d31b9fd66d493015937e7a3d49898c69 (diff)
Notes
-rw-r--r--sys/kern/kern_fork.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 714a1af63b59b..6e47e26bd6cac 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -533,8 +533,14 @@ again:
* p_limit is copy-on-write. Bump its refcount.
*/
p2->p_limit = lim_hold(p1->p_limit);
- PROC_UNLOCK(p1);
+
+ /*
+ * We don't need to prevent the parent from being swapped out just yet,
+ * but this is a convenient point to block to swap it in if needed.
+ */
PROC_UNLOCK(p2);
+ _PHOLD(p1);
+ PROC_UNLOCK(p1);
/* Bump references to the text vnode (for procfs) */
if (p2->p_textvp)
@@ -629,9 +635,8 @@ again:
/*
* This begins the section where we must prevent the parent
- * from being swapped.
+ * from being swapped. We already got a hold on the parent earlier.
*/
- _PHOLD(p1);
PROC_UNLOCK(p1);
/*