sched/fair: Fix negative imbalance in imbalance calculation
PATCH 1/1 sched/fair: Fix negative imbalance in imbalance calculation
A negative imbalance value was observed after imbalance calculation, this happens when the local sched group type is group_fully_busy, and the average load of local group is greater than the selected busiest group. Fix this problem by comparing the average load of the local and busiest group before imbalance calculation formula.
--- kernel/sched/fair.c | 8 ++++++++ 1 file changed, 8 insertions(+)
kernel/sched/fair.c +8 -0
@@ -8761,6 +8761,14 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s sds->avg_load = (sds->total_load *SCHED_CAPACITY_SCALE ) / sds->total_capacity; +/* +* If the local group is more loaded than the selected +* busiest group don't try to pull any tasks. +*/ +if (local->avg_load >= busiest->avg_load) { + env->imbalance =0 ; +return ; + } }/*
Signature · 1 line
2.7.4
Quoted 35 lines · On Thu, Mar 26, 2020 at 01:42:29PM +0800 Aubrey Li wrote:
A negative imbalance value was observed after imbalance calculation, this happens when the local sched group type is
group_fully_busy, and the average load of local group is greater than the selected busiest group. Fix this problem by comparing the average load of the local and busiest group before imbalance calculation formula.Suggested-by Vincent Guittot <[email protected]>Signed-off-by Aubrey Li <[email protected]>Cc Phil Auld <[email protected]>--- kernel/sched/fair.c | 8 ++++++++ 1 file changed, 8 insertions(+)kernel/sched/fair.c +8
-0@@ -8761,6 +8761,14 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s sds->avg_load = (sds->total_load *SCHED_CAPACITY_SCALE ) / sds->total_capacity; +/* +* If the local group is more loaded than the selected +* busiest group don't try to pull any tasks. +*/ +if (local->avg_load >= busiest->avg_load) { + env->imbalance =0 ; +return ; + } }/* Signature · 1 line
2.7.4
I like this one better. Thanks!
Quoted 10 lines · Aubrey Li
A negative imbalance value was observed after imbalance calculation, this happens when the local sched group type is
group_fully_busy, and the average load of local group is greater than the selected busiest group. Fix this problem by comparing the average load of the local and busiest group before imbalance calculation formula.Suggested-by Vincent Guittot <[email protected]>Signed-off-by Aubrey Li <[email protected]>Cc Phil Auld <[email protected]>
Quoted 26 lines
--- kernel/sched/fair.c | 8 ++++++++ 1 file changed, 8 insertions(+)kernel/sched/fair.c +8
-1@@ -8761,6 +8761,14 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s sds->avg_load = (sds->total_load *SCHED_CAPACITY_SCALE ) / sds->total_capacity; +/* +* If the local group is more loaded than the selected +* busiest group don't try to pull any tasks. +*/ +if (local->avg_load >= busiest->avg_load) { + env->imbalance =0 ; +return ; + } }/* -- 2.7.4
Peter Zijlstra
maintainerQuoted 8 lines · Vincent Guittot
Quoted 7 lines · Aubrey Li
A negative imbalance value was observed after imbalance calculation, this happens when the local sched group type is
group_fully_busy, and the average load of local group is greater than the selected busiest group. Fix this problem by comparing the average load of the local and busiest group before imbalance calculation formula.
Quoted 5 lines
Quoted 3 lines
Suggested-by Vincent Guittot <[email protected]>Signed-off-by Aubrey Li <[email protected]>Cc Phil Auld <[email protected]>Reviewed-by Vincent Guittot <[email protected]>
Thanks!
Quoted 9 lines · Aubrey Li
A negative imbalance value was observed after imbalance calculation, this happens when the local sched group type is
group_fully_busy, and the average load of local group is greater than the selected busiest group. Fix this problem by comparing the average load of the local and busiest group before imbalance calculation formula.Suggested-by Vincent Guittot <[email protected]>Signed-off-by Aubrey Li <[email protected]>Cc Phil Auld <[email protected]>
Signature · 2 lines
Mel Gorman SUSE Labs
The following commit has been merged into the sched/urgent branch of tip:
The following commit has been merged into the sched/urgent branch of tip:
Commit-ID: 111688ca1c4a43a7e482f5401f82c46326b8ed49 Gitweb: https://git.kernel.org/tip/111688ca1c4a43a7e482f5401f82c46326b8ed49 Author: Aubrey Li <[email protected]> AuthorDate: Thu, 26 Mar 2020 13:42:29 +08:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Wed, 08 Apr 2020 11:35:20 +02:00
sched/fair: Fix negative imbalance in imbalance calculation
A negative imbalance value was observed after imbalance calculation, this happens when the local sched group type is group_fully_busy, and the average load of local group is greater than the selected busiest group. Fix this problem by comparing the average load of the local and busiest group before imbalance calculation formula.
--- kernel/sched/fair.c | 8 ++++++++ 1 file changed, 8 insertions(+)
kernel/sched/fair.c +8 -0
@@ -9036,6 +9036,14 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s sds->avg_load = (sds->total_load *SCHED_CAPACITY_SCALE ) / sds->total_capacity; +/* +* If the local group is more loaded than the selected +* busiest group don't try to pull any tasks. +*/ +if (local->avg_load >= busiest->avg_load) { + env->imbalance =0 ; +return ; + } }/*