Skip to contentSkip to conversation

wait_task_inactive: fix the !CONFIG_SMP version

PATCH In review Oleg Nesterov 1 participant 1 message Jul 30, 2008 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 wait_task_inactive: fix the !CONFIG_SMP version

The semantics of wait_task_inactive() was changed, update the !SMP version accordingly.

include/linux/sched.h renamed from include/linux/sched.h~2_WTI_DUMMY +3 -1
@@ -1880,7 +1880,9 @@ extern unsigned long wait_task_inactive(
 static inline unsigned long wait_task_inactive(struct task_struct *p,
 					       long match_state)
 {
-	return 1;
+	if (match_state && unlikely(p->state != match_state))
+		return 0;
+	return p->nvcsw | LONG_MIN; /* sets MSB */
 }
 #endif