Re: [PATCH 2/3] sched/fair: Generalize misfit lb by adding a misfit reason

From: Qais Yousef
Date: Wed Jul 24 2024 - 17:35:43 EST


Hi Xuewen

On 07/17/24 16:26, Xuewen Yan wrote:
> Hi Qais
>
> On Sat, Dec 9, 2023 at 9:19 AM Qais Yousef <qyousef@xxxxxxxxxxx> wrote:

> > @@ -11008,6 +11025,7 @@ static struct rq *find_busiest_queue(struct lb_env *env,
> > * average load.
> > */
> > if (env->sd->flags & SD_ASYM_CPUCAPACITY &&
> > + rq->misfit_reason == MISFIT_PERF &&
>
> In Android, I found this would cause a task loop to change the CPUs.
> Maybe this should be removed. Because for the same capacity cpus, we
> should skip this cpu when nr_running=1.

Could you explain a bit more? Are you saying this is changing the behavior for
some use case? The check will ensure this path is only triggered for misfit
upmigration. Which AFAICT the only reason why this path was added.

The problem is that to implement another misfit reason, the check for
capacity_greater() is not true except for MISFIT_PERF. For MISFIT_POWER, we
want the CPU to be smaller.

I think Vincent is working on a better way to handle all of this now.

>
> > !capacity_greater(capacity_of(env->dst_cpu), capacity) &&
> > nr_running == 1)
> > continue;