sched: fix a find_busiest_group buglet
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Fri, 24 Oct 2008 09:06:12 +0000 (11:06 +0200)
committerIngo Molnar <mingo@elte.hu>
Fri, 24 Oct 2008 10:50:59 +0000 (12:50 +0200)
In one of the group load balancer patches:

commit 408ed066b11cf9ee4536573b4269ee3613bd735e
Author: Peter Zijlstra <a.p.zijlstra@chello.nl>
Date:   Fri Jun 27 13:41:28 2008 +0200
Subject: sched: hierarchical load vs find_busiest_group

The following change:

-               if (max_load - this_load + SCHED_LOAD_SCALE_FUZZ >=
+               if (max_load - this_load + 2*busiest_load_per_task >=
                                        busiest_load_per_task * imbn) {

made the condition always true, because imbn is [1,2].
Therefore, remove the 2*, and give the it a fair chance.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched.c

index 6625c3c..12bc367 100644 (file)
@@ -3344,7 +3344,7 @@ small_imbalance:
                } else
                        this_load_per_task = cpu_avg_load_per_task(this_cpu);
 
-               if (max_load - this_load + 2*busiest_load_per_task >=
+               if (max_load - this_load + busiest_load_per_task >=
                                        busiest_load_per_task * imbn) {
                        *imbalance = busiest_load_per_task;
                        return busiest;