diff options
author | Vincent Guittot <[email protected]> | 2018-12-14 17:01:55 +0100 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2019-01-27 12:29:37 +0100 |
commit | 4ad4e481bd02c80c4b9c64e563d16d1c4442ea13 (patch) | |
tree | a647af9570e5257e698f59dcf024df4ef84c91a3 | |
parent | a062d16449c0d2e00d5a54123c9cfadea3f6c763 (diff) |
sched/fair: Fix rounding bug for asym packing
When check_asym_packing() is triggered, the imbalance is set to:
busiest_stat.avg_load * busiest_stat.group_capacity / SCHED_CAPACITY_SCALE
But busiest_stat.avg_load equals:
sgs->group_load * SCHED_CAPACITY_SCALE / sgs->group_capacity
These divisions can generate a rounding that will make imbalance
slightly lower than the weighted load of the cfs_rq. But this is
enough to skip the rq in find_busiest_queue() and prevents asym
migration from happening.
Directly set imbalance to busiest's sgs->group_load to remove the
rounding.
Signed-off-by: Vincent Guittot <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Ingo Molnar <[email protected]>
-rw-r--r-- | kernel/sched/fair.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 9693cf2ea954..30450901200e 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8453,9 +8453,7 @@ static int check_asym_packing(struct lb_env *env, struct sd_lb_stats *sds) if (sched_asym_prefer(busiest_cpu, env->dst_cpu)) return 0; - env->imbalance = DIV_ROUND_CLOSEST( - sds->busiest_stat.avg_load * sds->busiest_stat.group_capacity, - SCHED_CAPACITY_SCALE); + env->imbalance = sds->busiest_stat.group_load; return 1; } |