sched/fair: Fix imbalance overflow

When local group is fully busy but its average load is above system load,
computing the imbalance will overflow and local group is not the best
target for pulling this load.

Fixes: 0b0695f2b34a ("sched/fair: Rework load_balance()")
Reported-by: Tingjia Cao <tjcao980311@gmail.com>
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Tingjia Cao <tjcao980311@gmail.com>
Link: https://lore.kernel.org/lkml/CABcWv9_DAhVBOq2=W=2ypKE9dKM5s2DvoV8-U0+GDwwuKZ89jQ@mail.gmail.com/T/

authored by Vincent Guittot and committed by Peter Zijlstra 91dcf1e8 09a9639e

Changed files
+10
kernel
sched
+10
kernel/sched/fair.c
··· 10238 10238 10239 10239 sds->avg_load = (sds->total_load * SCHED_CAPACITY_SCALE) / 10240 10240 sds->total_capacity; 10241 + 10242 + /* 10243 + * If the local group is more loaded than the average system 10244 + * load, don't try to pull any tasks. 10245 + */ 10246 + if (local->avg_load >= sds->avg_load) { 10247 + env->imbalance = 0; 10248 + return; 10249 + } 10250 + 10241 10251 } 10242 10252 10243 10253 /*