From: Qais Yousef <qyousef@layalina.io>
To: Xuewen Yan <xuewen.yan94@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
linux-kernel@vger.kernel.org, Lukasz Luba <lukasz.luba@arm.com>,
Wei Wang <wvw@google.com>, Rick Yiu <rickyiu@google.com>,
Chung-Kai Mei <chungkai@google.com>,
Xuewen Yan <xuewen.yan@unisoc.com>,
John Stultz <jstultz@google.com>
Subject: Re: [PATCH 2/3] sched/fair: Generalize misfit lb by adding a misfit reason
Date: Thu, 1 Aug 2024 13:21:15 +0100 [thread overview]
Message-ID: <20240801122115.lfxvc3dxa6b6eesl@airbuntu> (raw)
In-Reply-To: <CAB8ipk-PwCvaAaRQSnCsybBTz_9xGw6aqsn+4p3PM8Amz3OedQ@mail.gmail.com>
On 07/29/24 18:47, Xuewen Yan wrote:
> Hi Qais
>
> On Thu, Jul 25, 2024 at 5:35 AM Qais Yousef <qyousef@layalina.io> wrote:
> >
> > 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@layalina.io> 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.
>
> Sorry, it was my mistake.
Np, it's always good to hear back in case there's a problem :)
> After debugging, I found that there was a problem with my handling of
> MISFIT_PERF.
> But it is true that due to the influence of rt and irq load,
> capacity_greater() sometimes does cause some confusion.
> Sometimes we find that due to the different capacities between small
> cores, a misfit task will migrate several times between small cores,
> for example:
> If capacity_cpu3 > capacity_cpu2 > capacity_cpu1 >capacity_cpu0,
> the misfit task may migrate as follows: cpu0->cpu1->cpu2->cpu3.
> I don't know if this migration is really necessary, but it does cause
> me some confusion.
It should be cheap in theory.
But have you verified that the load_balance type is misfit and not load balance
trying to distribute load on little cores? I think it is harmless if it is
caused by misfit, but yes looks unnecessary to me too.
I'd love to remove this 5% magic margin, but I have no idea how yet.
next prev parent reply other threads:[~2024-08-01 12:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-09 1:17 [PATCH 0/3] sched: Generalize misfit load balance Qais Yousef
2023-12-09 1:17 ` [PATCH 1/3] sched/fair: Add is_misfit_task() function Qais Yousef
2023-12-09 1:17 ` [PATCH 2/3] sched/fair: Generalize misfit lb by adding a misfit reason Qais Yousef
2024-07-17 8:26 ` Xuewen Yan
2024-07-24 21:35 ` Qais Yousef
2024-07-29 10:47 ` Xuewen Yan
2024-08-01 12:21 ` Qais Yousef [this message]
2023-12-09 1:17 ` [PATCH RFC 3/3] sched/fair: Implement new type of misfit MISFIT_POWER Qais Yousef
2023-12-11 16:14 ` Pierre Gondois
2024-01-04 14:28 ` Pierre Gondois
2024-01-05 1:21 ` Qais Yousef
2023-12-21 15:26 ` [PATCH 0/3] sched: Generalize misfit load balance Pierre Gondois
2023-12-28 23:38 ` Qais Yousef
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240801122115.lfxvc3dxa6b6eesl@airbuntu \
--to=qyousef@layalina.io \
--cc=chungkai@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=jstultz@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rickyiu@google.com \
--cc=vincent.guittot@linaro.org \
--cc=wvw@google.com \
--cc=xuewen.yan94@gmail.com \
--cc=xuewen.yan@unisoc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®