PERFORCE change 91396 for review

John Baldwin jhb at FreeBSD.org
Wed Feb 8 08:29:37 PST 2006


http://perforce.freebsd.org/chv.cgi?CH=91396

Change 91396 by jhb at jhb_slimer on 2006/02/08 16:28:49

	Don't block waiting on _PRELE's until after we've woken up any
	procfs waiters.

Affected files ...

.. //depot/projects/smpng/sys/kern/kern_exit.c#110 edit

Differences ...

==== //depot/projects/smpng/sys/kern/kern_exit.c#110 (text+ko) ====

@@ -175,13 +175,6 @@
 
 	p->p_flag |= P_WEXIT;
 
-	/*
-	 * Wait for any processes that have a hold on our vmspace to
-	 * release their reference.
-	 */
-	while (p->p_lock > 0)
-		msleep(&p->p_lock, &p->p_mtx, PWAIT, "exithold", 0);
-
 	PROC_LOCK(p->p_pptr);
 	sigqueue_take(p->p_ksi);
 	PROC_UNLOCK(p->p_pptr);
@@ -205,7 +198,21 @@
 
 	PROC_LOCK(p);
 	_STOPEVENT(p, S_EXIT, rv);
-	wakeup(&p->p_stype);	/* Wakeup anyone in procfs' PIOCWAIT */
+
+	/*
+	 * Wakeup anyone in procfs' PIOCWAIT.  They should have a hold
+	 * on our vmspace, so we should block below until they have
+	 * released their reference to us.
+	 */
+	wakeup(&p->p_stype);
+
+	/*
+	 * Wait for any processes that have a hold on our vmspace to
+	 * release their reference.
+	 */
+	while (p->p_lock > 0)
+		msleep(&p->p_lock, &p->p_mtx, PWAIT, "exithold", 0);
+
 	PROC_UNLOCK(p);
 
 	/*


More information about the p4-projects mailing list