mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tim Chen <tim.c.chen@linux.intel.com>
To: Zhan Xusheng <zhanxusheng1024@gmail.com>, yu.c.chen@intel.com
Cc: kprateek.nayak@amd.com, mingo@redhat.com, juri.lelli@redhat.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
Subject: Re: [PATCH] sched/cache: Fix a thread aggregation conflict when there is one runnable task
Date: Tue, 28 Jul 2026 07:26:46 -0700	[thread overview]
Message-ID: <fd36d9d0a123efe24068e66ca987e762d48e0b73.camel@linux.intel.com> (raw)
In-Reply-To: <20260727121730.2148901-1-zhanxusheng1024@gmail.com>

On Mon, 2026-07-27 at 20:39 +0800, Zhan Xusheng wrote:
> 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.

My understanding is that SD_ASYM_CPUCAPACITY is mostly used in the hybrid
CPU situations (e.g. P-core and E-core on some Intel client CPUs). For
those, the difference in CPU performance is pretty significant and we
likely will not get as much performance back from cache co-location vs the
CPU capacity. So I think we can leave the SD_ASYM_CPUCAPACITY code as is
till we come across a workload and platform that shows otherwise.

Otherwise,

Reviewed-by: Tim Chen <tim.c.chen@linux.intel.com>

Tim

> 
> Reviewed-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
> 
> Thanks,
> Xusheng

      reply	other threads:[~2026-07-28 14:26 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
2026-07-28 14:26       ` Tim Chen [this message]

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=fd36d9d0a123efe24068e66ca987e762d48e0b73.camel@linux.intel.com \
    --to=tim.c.chen@linux.intel.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=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=yi1.lai@intel.com \
    --cc=yu.c.chen@intel.com \
    --cc=zhanxusheng1024@gmail.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

Powered by JetHome