Re: [PATCH v3 4/6] sched/fair: Carve out logic to mark a group for asymmetric packing

From: Dietmar Eggemann
Date: Mon May 17 2021 - 10:25:39 EST


On 13/05/2021 17:49, Ricardo Neri wrote:

[...]

> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index c8c04e9d0d3b..c8b66a5d593e 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -8447,6 +8447,20 @@ group_type group_classify(unsigned int imbalance_pct,
> return group_has_spare;
> }
>
> +static inline bool
> +sched_asym(struct lb_env *env, struct sd_lb_stats *sds, struct sg_lb_stats *sgs,
> + struct sched_group *group)
> +{
> + /*
> + * Because sd->groups starts with the local group, anything that isn't
> + * the local group will have access to the local state.
> + */
> + if (group == sds->local)
> + return false;

sched_asym() is called under if(!local_group ...) from
update_sg_lb_stats(). So why checking this here again?

[...]