PERFORCE change 100784 for review

John Baldwin jhb at FreeBSD.org
Thu Jul 6 18:30:07 UTC 2006


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

Change 100784 by jhb at jhb_mutex on 2006/07/06 18:29:47

	Revert this change.  It ends up tripping a panic because in the
	case of an "extra" thread exiting td_ksegrp will be NULL when we
	do PROC_UNLOCK().  If the proc mtx is contested and this thread
	has a regular user priority for it's base priority, then in
	sched_unlend_prio() when we go to fetch the most recent user
	priority from the ksegroup we panic.

Affected files ...

.. //depot/projects/smpng/sys/kern/kern_thread.c#91 edit

Differences ...

==== //depot/projects/smpng/sys/kern/kern_thread.c#91 (text+ko) ====

@@ -579,6 +579,7 @@
 				ksegrp_unlink(kg);
 				ksegrp_stash(kg);
 			}
+			PROC_UNLOCK(p);
 			td->td_ksegrp	= NULL;
 			PCPU_SET(deadthread, td);
 		} else {
@@ -601,9 +602,9 @@
 		 * This includes an EX threaded process that is coming
 		 * here via exit1(). (exit1 dethreads the proc first).
 		 */
+		PROC_UNLOCK(p);
 	}
 
-	PROC_UNLOCK(p);
 	td->td_state = TDS_INACTIVE;
 	CTR1(KTR_PROC, "thread_exit: cpu_throw() thread %p", td);
 	cpu_throw(td, choosethread());


More information about the p4-projects mailing list