]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - kernel/sched_fair.c
Merge branch 'sched/urgent' into sched/core
[net-next-2.6.git] / kernel / sched_fair.c
index b45abbe5506793fbb063c21b4c6763bdb8f28de4..ff7692ccda893d31ebcebcd577762625761b7640 100644 (file)
@@ -2792,12 +2792,23 @@ find_busiest_queue(struct sched_group *group, enum cpu_idle_type idle,
                        continue;
 
                rq = cpu_rq(i);
-               wl = weighted_cpuload(i) * SCHED_LOAD_SCALE;
-               wl /= power;
+               wl = weighted_cpuload(i);
 
+               /*
+                * When comparing with imbalance, use weighted_cpuload()
+                * which is not scaled with the cpu power.
+                */
                if (capacity && rq->nr_running == 1 && wl > imbalance)
                        continue;
 
+               /*
+                * For the load comparisons with the other cpu's, consider
+                * the weighted_cpuload() scaled with the cpu power, so that
+                * the load can be moved away from the cpu that is potentially
+                * running at a lower capacity.
+                */
+               wl = (wl * SCHED_LOAD_SCALE) / power;
+
                if (wl > max_load) {
                        max_load = wl;
                        busiest = rq;