PERFORCE change 61573 for review

Julian Elischer julian at FreeBSD.org
Wed Sep 15 15:47:37 PDT 2004


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

Change 61573 by julian at julian_ref on 2004/09/15 22:46:43

	 fix backing out of runq addition for preempting threads.

Affected files ...

.. //depot/projects/nsched/sys/kern/kern_switch.c#32 edit

Differences ...

==== //depot/projects/nsched/sys/kern/kern_switch.c#32 (text+ko) ====

@@ -591,8 +591,16 @@
 		/*
 		 * If this is a threaded process we actually ARE on the
 		 * ksegrp run queue so take it off that first.
+		 * Also undo any damage done to the last_assigned pointer.
+		 * XXX Fix setrunqueue so this isn't needed
 		 */
-		remrunqueue(td); /* maybe use a simpler version */
+		struct ksegrp *kg;
+
+		kg = td->td_ksegrp;
+		if (kg->kg_last_assigned == td) 
+			kg->kg_last_assigned =
+			    TAILQ_PREV(td, threadqueue, td_runq);
+		TAILQ_REMOVE(&kg->kg_runq, td, td_runq);
 	}
 		
 	TD_SET_RUNNING(td);


More information about the p4-projects mailing list