PERFORCE change 93109 for review

John Baldwin jhb at FreeBSD.org
Sat Mar 11 01:15:57 GMT 2006


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

Change 93109 by jhb at jhb_slimer on 2006/03/10 14:06:37

	Do the kdb check earlier in mi_switch() to avoid doublecounting
	rux_runtime.

Affected files ...

.. //depot/projects/smpng/sys/kern/kern_synch.c#99 edit

Differences ...

==== //depot/projects/smpng/sys/kern/kern_synch.c#99 (text+ko) ====

@@ -355,6 +355,16 @@
 	    ("mi_switch: switch must be voluntary or involuntary"));
 	KASSERT(newtd != curthread, ("mi_switch: preempting back to ourself"));
 
+	/*
+	 * Don't perform context switches from the debugger.
+	 */
+	if (kdb_active) {
+		mtx_unlock_spin(&sched_lock);
+		kdb_backtrace();
+		kdb_reenter();
+		panic("%s: did not reenter debugger", __func__);
+	}
+
 	if (flags & SW_VOL)
 		p->p_stats->p_ru.ru_nvcsw++;
 	else
@@ -376,16 +386,6 @@
 	td->td_generation++;	/* bump preempt-detect counter */
 
 	/*
-	 * Don't perform context switches from the debugger.
-	 */
-	if (kdb_active) {
-		mtx_unlock_spin(&sched_lock);
-		kdb_backtrace();
-		kdb_reenter();
-		panic("%s: did not reenter debugger", __func__);
-	}
-
-	/*
 	 * Check if the process exceeds its cpu resource allocation.  If
 	 * it reaches the max, arrange to kill the process in ast().
 	 */


More information about the p4-projects mailing list