aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched
diff options
context:
space:
mode:
authorWanpeng Li <wanpeng.li@linux.intel.com>2014-11-04 18:44:50 -0500
committerIngo Molnar <mingo@kernel.org>2014-11-16 04:58:56 -0500
commitcb0b9f2445cdf9893352e4548582a2892af7137c (patch)
tree9d30455e431ebe9d342dbbc1670d4e9bc59ffcd8 /kernel/sched
parent6c1d9410f007a26d13173cf17204cfd965f49b83 (diff)
sched/fair: Fix stale overloaded status in the busiest group finding logic
Commit caeb178c60f4 ("sched/fair: Make update_sd_pick_busiest() return 'true' on a busier sd") changes groups to be ranked in the order of overloaded > imbalance > other, and busiest group is picked according to this order. sgs->group_capacity_factor is used to check if the group is overloaded. When the child domain prefers tasks to go to siblings first, the sgs->group_capacity_factor will be set lower than one in order to move all the excess tasks away. However, group overloaded status is not updated when sgs->group_capacity_factor is set to lower than one, which leads to us missing to find the busiest group. This patch fixes it by updating group overloaded status when sg capacity factor is set to one, in order to find the busiest group accurately. Signed-off-by: Wanpeng Li <wanpeng.li@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Rik van Riel <riel@redhat.com> Cc: Vincent Guittot <vincent.guittot@linaro.org> Cc: Kirill Tkhai <ktkhai@parallels.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: http://lkml.kernel.org/r/1415144690-25196-1-git-send-email-wanpeng.li@linux.intel.com [ Fixed the changelog. ] Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/fair.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 8bca292f0803..df2cdf77f899 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6352,8 +6352,10 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd
6352 * with a large weight task outweighs the tasks on the system). 6352 * with a large weight task outweighs the tasks on the system).
6353 */ 6353 */
6354 if (prefer_sibling && sds->local && 6354 if (prefer_sibling && sds->local &&
6355 sds->local_stat.group_has_free_capacity) 6355 sds->local_stat.group_has_free_capacity) {
6356 sgs->group_capacity_factor = min(sgs->group_capacity_factor, 1U); 6356 sgs->group_capacity_factor = min(sgs->group_capacity_factor, 1U);
6357 sgs->group_type = group_classify(sg, sgs);
6358 }
6357 6359
6358 if (update_sd_pick_busiest(env, sds, sg, sgs)) { 6360 if (update_sd_pick_busiest(env, sds, sg, sgs)) {
6359 sds->busiest = sg; 6361 sds->busiest = sg;