Skip to content

Commit

Permalink
sched: fix a find_busiest_group buglet
Browse files Browse the repository at this point in the history
In one of the group load balancer patches:

	commit 408ed06
	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>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Oct 24, 2008
1 parent 8c82a17 commit 01c8c57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -3344,7 +3344,7 @@ find_busiest_group(struct sched_domain *sd, int this_cpu,
} 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;
Expand Down

0 comments on commit 01c8c57

Please sign in to comment.