From: Lu Wang <wanglu.priv@gmail.com>
To: yu.c.chen@intel.com
Cc: tim.c.chen@linux.intel.com, peterz@infradead.org,
mingo@redhat.com, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
vschneid@redhat.com, kprateek.nayak@amd.com,
linux-kernel@vger.kernel.org, chen.yu@linux.dev,
Lu Wang <wanglu.priv@gmail.com>
Subject: Re: [PATCH] sched/cache: honor migrate_llc_task semantics in active load balance
Date: Mon, 3 Aug 2026 18:02:27 +0800 [thread overview]
Message-ID: <20260803100227.2585560-1-wanglu.priv@gmail.com> (raw)
In-Reply-To: <b303e412-1bdc-4658-adfe-2e7b03e908ef@intel.com>
Thanks for the review, Chenyu.
I got interested in CAS because it strikes a good balance between
generic CFS load balancing and strict LLC/CPU affinity.
My understanding is that migrate_llc_task encodes the target
direction of the balance pass, not just "ALB was triggered by CAS".
alb_break_llc() only vetoes ALB when every task on src_rq prefers
staying put (nr_pref_llc_running == cfs.h_nr_runnable); once tasks
have mixed preferences it lets ALB through without checking which
one gets picked. active_load_balance_cpu_stop() then walks
src_rq->cfs_tasks in reverse and takes the first task accepted by
can_migrate_task() — with multiple tasks on src_rq, that's not
necessarily the one whose preferred_llc matches the destination.
My patch threads migration_type through to the stopper and, only
for migrate_llc_task, rejects a candidate whose preferred_llc
doesn't match the destination LLC.
Regarding:
> this helps the case where the task is the only running one on the
> src_cpu
If that single task already prefers the destination LLC, my check
still returns true, so this case is unaffected. The disagreement is
really about what happens when it does not prefer the destination.
That comes down to how we read the semantics of migrate_llc_task:
(a) "migrate a task toward the destination LLC selected by
calculate_imbalance()", or
(b) "this ALB was triggered by CAS's LLC-balance logic, so any
generally-eligible task on src_rq may be pushed"
If (a), the per-task check is needed.
Happy to discuss further.
next prev parent reply other threads:[~2026-08-03 10:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-01 12:22 [PATCH] sched/cache: honor migrate_llc_task semantics in active load balance Lu Wang
2026-08-03 4:20 ` Chen, Yu C
2026-08-03 10:02 ` Lu Wang [this message]
2026-08-04 0:10 ` Tim Chen
2026-08-04 8:17 ` Chen, Yu C
2026-08-04 8:30 ` Lu Wang
-- strict thread matches above, loose matches on Subject: below --
2026-08-01 12:17 Lu Wang
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=20260803100227.2585560-1-wanglu.priv@gmail.com \
--to=wanglu.priv@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=yu.c.chen@intel.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