Apparently we don't want to see sds->busiest_nr_running is small than sds->busiest_group_capacity, while our load_above_capacity is an "unsigned long" type.
Signed-off-by: Lei Wen <lei...@marvell.com> --- kernel/sched/fair.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index c61a614..fd90b17 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4780,12 +4780,17 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s /* * Don't want to pull so many tasks that a group would go idle. */ - load_above_capacity = (sds->busiest_nr_running - - sds->busiest_group_capacity); + if (sds->busiest_has_capacity) + load_above_capacity = 0; + else { + load_above_capacity = (sds->busiest_nr_running - + sds->busiest_group_capacity); - load_above_capacity *= (SCHED_LOAD_SCALE * SCHED_POWER_SCALE); + load_above_capacity *= + (SCHED_LOAD_SCALE * SCHED_POWER_SCALE); - load_above_capacity /= sds->busiest->sgp->power; + load_above_capacity /= sds->busiest->sgp->power; + } } /* -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/