]> git.hungrycats.org Git - linux/commitdiff
[PATCH] small migration thread fix
authorErich Focht <efocht@ess.nec.de>
Fri, 10 Jan 2003 01:15:12 +0000 (17:15 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Fri, 10 Jan 2003 01:15:12 +0000 (17:15 -0800)
This fixes a potential problem in the migration thread for the case that
the first CPU in the cpus_allowed mask of a process is offline.

kernel/sched.c

index 152d8f7bad9a57278fa625dddb6727062022a8dd..5f9d3ae29eeed366ca8538c24ed759f5c413eed6 100644 (file)
@@ -2108,7 +2108,7 @@ static int migration_thread(void * data)
                spin_unlock_irqrestore(&rq->lock, flags);
 
                p = req->task;
-               cpu_dest = __ffs(p->cpus_allowed);
+               cpu_dest = __ffs(p->cpus_allowed & cpu_online_map);
                rq_dest = cpu_rq(cpu_dest);
 repeat:
                cpu_src = task_cpu(p);