Re: [PATCH v5 2/6] sched/fair: Also gate overloaded status update for SD_ASYM_CPUCAPACITY
From: Vincent Guittot
Date: Tue Jun 23 2026 - 03:17:48 EST
On Tue, 23 Jun 2026 at 01:55, Ricardo Neri
<ricardo.neri-calderon@xxxxxxxxxxxxxxx> wrote:
>
> The argument sg_overloaded of update_sg_lb_stats() is only consumed when
> balancing at the root domain. It only makes sense to update it in such a
> case. Commit 3229adbe7875 ("sched/fair: Do not compute overloaded status
> unnecessarily during lb") updated the logic accordingly but missed the case
> in which the root domain has the SD_ASYM_CPUCAPACITY flag. Fix this.
>
> Fixes: 3229adbe7875 ("sched/fair: Do not compute overloaded status unnecessarily during lb")
> Tested-by: Christian Loehle <christian.loehle@xxxxxxx>
> Reported-by: Chen Yu <yu.c.chen@xxxxxxxxx>
> Signed-off-by: Ricardo Neri <ricardo.neri-calderon@xxxxxxxxxxxxxxx>
Reviewed-by: Vincent Guittot <vincent.guittot@xxxxxxxxxx>
> ---
> Changes in v5:
> * Added Tested-by tag from Christian. Thanks!
>
> Changes in v4:
> * Introduced this patch.
>
> Changes in v3:
> * N/A
>
> Changes in v2:
> * N/A
> ---
> kernel/sched/fair.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 892abd7fcc18..31baa0000616 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -11863,7 +11863,9 @@ static inline void update_sg_lb_stats(struct lb_env *env,
> /* Check for a misfit task on the cpu */
> if (sgs->group_misfit_task_load < rq->misfit_task_load) {
> sgs->group_misfit_task_load = rq->misfit_task_load;
> - *sg_overloaded = 1;
> +
> + if (balancing_at_rd)
> + *sg_overloaded = 1;
> }
> } else if (env->idle && sched_reduced_capacity(rq, env->sd)) {
> /* Check for a task running on a CPU with reduced capacity */
>
> --
> 2.43.0
>