sched: Fix incorrect sanity check
authorPeter Zijlstra <peterz@infradead.org>
Thu, 21 Jan 2010 15:34:27 +0000 (16:34 +0100)
committerIngo Molnar <mingo@elte.hu>
Thu, 28 Jan 2010 05:59:51 +0000 (06:59 +0100)
We moved to migrate on wakeup, which means that sleeping tasks could
still be present on offline cpus. Amend the check to only test running
tasks.

Reported-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/cpu.c

index 1c8ddd6ee9402fdf2f6853c6142f3a8d0cb57da6..08e54e7beaed19f87766053349ae5b3c3f333a18 100644 (file)
@@ -151,7 +151,7 @@ static inline void check_for_tasks(int cpu)
 
        write_lock_irq(&tasklist_lock);
        for_each_process(p) {
-               if (task_cpu(p) == cpu &&
+               if (task_cpu(p) == cpu && p->state == TASK_RUNNING &&
                    (!cputime_eq(p->utime, cputime_zero) ||
                     !cputime_eq(p->stime, cputime_zero)))
                        printk(KERN_WARNING "Task %s (pid = %d) is on cpu %d\