Skip to contentSkip to conversation

kernel/sched.c: fix subtle TASK_RUNNING compare

PATCH New Domen Puncer 1 participant 1 message Nov 18, 2004 Kernel janitors

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel/sched.c: fix subtle TASK_RUNNING compare

Hi.

This test was depending on TASK_RUNNING being defined as 0.

kernel/sched.c +2 -1
@@ -2576,7 +2576,8 @@ need_resched_nonpreemptible:
 	 * to picking the next task.
 	 */
 	switch_count = &prev->nivcsw;
-	if (prev->state && !(preempt_count() & PREEMPT_ACTIVE)) {
+	if (prev->state != TASK_RUNNING &&
+			!(preempt_count() & PREEMPT_ACTIVE)) {
 		switch_count = &prev->nvcsw;
 		if (unlikely((prev->state & TASK_INTERRUPTIBLE) &&
 				unlikely(signal_pending(prev))))

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors