From: Zhan Xusheng <zhanxusheng1024@gmail.com>
To: yu.c.chen@intel.com
Cc: kprateek.nayak@amd.com, mingo@redhat.com, juri.lelli@redhat.com,
tim.c.chen@linux.intel.com, vschneid@redhat.com, mgorman@suse.de,
rostedt@goodmis.org, dietmar.eggemann@arm.com,
bsegall@google.com, yi1.lai@intel.com,
linux-kernel@vger.kernel.org, zhanxusheng@xiaomi.com,
peterz@infradead.org, vincent.guittot@linaro.org,
chen.yu@linux.dev, Zhan Xusheng <zhanxusheng1024@gmail.com>
Subject: Re: [PATCH] sched/cache: Fix a thread aggregation conflict when there is one runnable task
Date: Mon, 27 Jul 2026 20:39:25 +0800 [thread overview]
Message-ID: <20260727121730.2148901-1-zhanxusheng1024@gmail.com> (raw)
In-Reply-To: <70eb8310-bc01-4598-99e5-c53bf101a36d@intel.com>
From: Zhan Xusheng <zhanxusheng1024@gmail.com>
On 7/27/2026 5:46 PM, Chen, Yu C wrote:
> I did a further investigation, and another reason it holds: with only one
> running task, migrate_degrades_llc() is not what keeps the task in its
> preferred LLC. In the regular load balance path can_migrate_task() already
> bails at task_on_cpu() - since that task is curr. And in the active balance
> path alb_break_llc() blocks it first:
>
> if (env->src_rq->nr_running <= 1)
> return true;
>
> so the task is not pulled back either way.
Thanks, that all makes sense. I traced both guards and they hold:
- Regular load balance: for the single running task can_migrate_task()
returns 0 at the task_on_cpu() check, so it is never pulled back on the
normal path (and for a non-running task the migrate_degrades_llc() ->
can_migrate_llc_task() == mig_forbid check catches it).
- Active balance: need_active_balance() -> alb_break_llc() returns true
because nr_pref_llc_running == h_nr_runnable and src_rq->nr_running <= 1.
What convinced me it is not symmetric - i.e. that the forward
migrate_llc_task still works - is that in the forward direction the task
does not prefer the source LLC, so nr_pref_llc_running == 0 there and
alb_break_llc() returns false.
> Good point. OK, let me add description in changelog:
> The adjacent SD_ASYM_CPUCAPACITY filter was left unchanged. In theory
> it should have been handled in the same way, but it is not clear yet
> whether any platform has both multiple LLCs and asymmetric CPU capacity,
> so the asymmetric CPU capacity logic was not fine-tuned here and can be
> revisited once such a platform shows up.
That wording answers my question well - thanks for spelling out that
leaving the capacity filter alone is intentional pending a multi-LLC +
asym-capacity platform.
Reviewed-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
Thanks,
Xusheng
next prev parent reply other threads:[~2026-07-27 12:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 1:29 Chen Yu
2026-07-27 6:41 ` Zhan Xusheng
2026-07-27 9:46 ` Chen, Yu C
2026-07-27 12:39 ` Zhan Xusheng [this message]
2026-07-28 14:26 ` Tim Chen
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=20260727121730.2148901-1-zhanxusheng1024@gmail.com \
--to=zhanxusheng1024@gmail.com \
--cc=bsegall@google.com \
--cc=chen.yu@linux.dev \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tim.c.chen@linux.intel.com \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=yi1.lai@intel.com \
--cc=yu.c.chen@intel.com \
--cc=zhanxusheng@xiaomi.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®