aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorVaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>2008-12-18 12:56:16 -0500
committerIngo Molnar <mingo@elte.hu>2008-12-19 03:21:48 -0500
commitd5679bd11916eba5c8ee9033003e1a5ce56ece9a (patch)
treebb7c1bef4446e606ea23e4e6711a48013fed3666 /kernel/sched.c
parentafb8a9b70b86866a60e08b2956ae4e1406390336 (diff)
sched: favour lower logical cpu number for sched_mc balance
Impact: change load-balancing direction to match that of irqbalanced Just in case two groups have identical load, prefer to move load to lower logical cpu number rather than the present logic of moving to higher logical number. find_busiest_group() tries to look for a group_leader that has spare capacity to take more tasks and freeup an appropriate least loaded group. Just in case there is a tie and the load is equal, then the group with higher logical number is favoured. This conflicts with user space irqbalance daemon that will move interrupts to lower logical number if the system utilisation is very low. Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 56b285cd5350..94b9d11e3312 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3241,7 +3241,7 @@ find_busiest_group(struct sched_domain *sd, int this_cpu,
3241 */ 3241 */
3242 if ((sum_nr_running < min_nr_running) || 3242 if ((sum_nr_running < min_nr_running) ||
3243 (sum_nr_running == min_nr_running && 3243 (sum_nr_running == min_nr_running &&
3244 cpumask_first(sched_group_cpus(group)) < 3244 cpumask_first(sched_group_cpus(group)) >
3245 cpumask_first(sched_group_cpus(group_min)))) { 3245 cpumask_first(sched_group_cpus(group_min)))) {
3246 group_min = group; 3246 group_min = group;
3247 min_nr_running = sum_nr_running; 3247 min_nr_running = sum_nr_running;
@@ -3257,7 +3257,7 @@ find_busiest_group(struct sched_domain *sd, int this_cpu,
3257 if (sum_nr_running <= group_capacity - 1) { 3257 if (sum_nr_running <= group_capacity - 1) {
3258 if (sum_nr_running > leader_nr_running || 3258 if (sum_nr_running > leader_nr_running ||
3259 (sum_nr_running == leader_nr_running && 3259 (sum_nr_running == leader_nr_running &&
3260 cpumask_first(sched_group_cpus(group)) > 3260 cpumask_first(sched_group_cpus(group)) <
3261 cpumask_first(sched_group_cpus(group_leader)))) { 3261 cpumask_first(sched_group_cpus(group_leader)))) {
3262 group_leader = group; 3262 group_leader = group;
3263 leader_nr_running = sum_nr_running; 3263 leader_nr_running = sum_nr_running;