lkml.org 
[lkml]   [2022]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sched/fair: Return the busiest group only if imbalance is meaningful
On 06/04/2022 17:33, Vincent Guittot wrote:
> On Wed, 6 Apr 2022 at 17:07, 彭志刚 <zgpeng.linux@gmail.com> wrote:

[...]

> I think that this case should be covered by an additional test in
> calculate_imbalance because we should not try to pull load in groupA
> if it's already above the average load. Something like below should
> cover this
>
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -9469,6 +9469,16 @@ 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;
> +
> + /*
> + * Don't pull any tasks if this group is already above the
> + * domain average load.
> + */
> + if (local->avg_load >= sds->avg_load) {
> + env->imbalance = 0;
> + return;
> + }
> +

LGTM. Like for the `local->group_type == group_overloaded` case in
find_busiest_group() where we force `goto out_balanced`.

[...]

\
 
 \ /
  Last update: 2022-04-07 17:28    [W:0.056 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site