]> git.hungrycats.org Git - linux/commitdiff
[PATCH] CPU scheduler CAN_MIGRATE fix
authorAndrew Morton <akpm@osdl.org>
Tue, 9 Sep 2003 17:21:46 +0000 (10:21 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Tue, 9 Sep 2003 17:21:46 +0000 (10:21 -0700)
From: Andrew Theurer <habanero@us.ibm.com>

This change:
http://linux.bkbits.net:8080/linux-2.5/diffs/kernel/sched.c@1.202

does not seem to make sense:

#define CAN_MIGRATE_TASK(p,rq,this_cpu) \
((!idle || (jiffies - (p)->last_run > cache_decay_ticks)) &&    \
!task_running(rq, p) && \
cpu_isset(this_cpu, (p)->cpus_allowed))

It should be just the opposite; an idle cpu should be able to have a more
aggressive steal, and a busy cpu should not.

kernel/sched.c

index 51241d70f924fbaba1219adc5eac6fdcc1739430..89f1bb28dacdc994e97ae3cddd0930aabdc0ec72 100644 (file)
@@ -1064,7 +1064,7 @@ skip_queue:
         */
 
 #define CAN_MIGRATE_TASK(p,rq,this_cpu)                                        \
-       ((!idle || (jiffies - (p)->last_run > cache_decay_ticks)) &&    \
+       ((idle || (jiffies - (p)->last_run > cache_decay_ticks)) &&     \
                !task_running(rq, p) &&                                 \
                        cpu_isset(this_cpu, (p)->cpus_allowed))