diff options
author | Peter Zijlstra <peterz@infradead.org> | 2014-07-29 17:00:21 +0200 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2014-12-04 10:47:35 +0800 |
commit | 8f0b7f888734a7ad8a4366b8b07204e3fb62aa9c (patch) | |
tree | 4ec111326b847c74a0e34229b96596e2553d7938 | |
parent | 8badc85821cf5f5c8111a70c8223061788c81f4f (diff) |
sched/fair: Make calculate_imbalance() independent
Rik noticed that calculate_imbalance() relies on
update_sd_pick_busiest() to guarantee that busiest->sum_nr_running >
busiest->group_capacity_factor.
Break this implicit assumption (with the intent of not providing it
anymore) by having calculat_imbalance() verify it and not rely on
others.
Reported-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Link: http://lkml.kernel.org/r/20140729152631.GW12054@laptop.lan
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit 743cb1ff191f00fee653212bdbcee1e56086d6ce)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
-rw-r--r-- | kernel/sched/fair.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 6a2e8d79f9d..33a1ee169de 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5014,7 +5014,7 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s return fix_small_imbalance(env, sds); } - if (!busiest->group_imb) { + if (busiest->sum_nr_running > busiest->group_capacity_factor) { /* * Don't want to pull so many tasks that a group would go idle. * Except of course for the group_imb case, since then we might |