diff options
-rw-r--r-- | kernel/sched_fair.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 03496ebc4553..3a88dee165c0 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -2743,7 +2743,7 @@ static inline void update_sg_lb_stats(struct sched_domain *sd, | |||
2743 | 2743 | ||
2744 | /* | 2744 | /* |
2745 | * Consider the group unbalanced when the imbalance is larger | 2745 | * Consider the group unbalanced when the imbalance is larger |
2746 | * than the average weight of two tasks. | 2746 | * than the average weight of a task. |
2747 | * | 2747 | * |
2748 | * APZ: with cgroup the avg task weight can vary wildly and | 2748 | * APZ: with cgroup the avg task weight can vary wildly and |
2749 | * might not be a suitable number - should we keep a | 2749 | * might not be a suitable number - should we keep a |
@@ -2753,7 +2753,7 @@ static inline void update_sg_lb_stats(struct sched_domain *sd, | |||
2753 | if (sgs->sum_nr_running) | 2753 | if (sgs->sum_nr_running) |
2754 | avg_load_per_task = sgs->sum_weighted_load / sgs->sum_nr_running; | 2754 | avg_load_per_task = sgs->sum_weighted_load / sgs->sum_nr_running; |
2755 | 2755 | ||
2756 | if ((max_cpu_load - min_cpu_load) > 2*avg_load_per_task && max_nr_running > 1) | 2756 | if ((max_cpu_load - min_cpu_load) >= avg_load_per_task && max_nr_running > 1) |
2757 | sgs->group_imb = 1; | 2757 | sgs->group_imb = 1; |
2758 | 2758 | ||
2759 | sgs->group_capacity = DIV_ROUND_CLOSEST(group->cpu_power, SCHED_LOAD_SCALE); | 2759 | sgs->group_capacity = DIV_ROUND_CLOSEST(group->cpu_power, SCHED_LOAD_SCALE); |
@@ -3128,6 +3128,14 @@ find_busiest_group(struct sched_domain *sd, int this_cpu, | |||
3128 | if (!sds.busiest || sds.busiest_nr_running == 0) | 3128 | if (!sds.busiest || sds.busiest_nr_running == 0) |
3129 | goto out_balanced; | 3129 | goto out_balanced; |
3130 | 3130 | ||
3131 | /* | ||
3132 | * If the busiest group is imbalanced the below checks don't | ||
3133 | * work because they assumes all things are equal, which typically | ||
3134 | * isn't true due to cpus_allowed constraints and the like. | ||
3135 | */ | ||
3136 | if (sds.group_imb) | ||
3137 | goto force_balance; | ||
3138 | |||
3131 | /* SD_BALANCE_NEWIDLE trumps SMP nice when underutilized */ | 3139 | /* SD_BALANCE_NEWIDLE trumps SMP nice when underutilized */ |
3132 | if (idle == CPU_NEWLY_IDLE && sds.this_has_capacity && | 3140 | if (idle == CPU_NEWLY_IDLE && sds.this_has_capacity && |
3133 | !sds.busiest_has_capacity) | 3141 | !sds.busiest_has_capacity) |