The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Chen, Yu C" <yu.c.chen@intel.com>
To: Lu Wang <wanglu.priv@gmail.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" <chen.yu@linux.dev>
Subject: Re: [PATCH] sched/cache: honor migrate_llc_task semantics in active load balance
Date: Mon, 3 Aug 2026 12:20:03 +0800	[thread overview]
Message-ID: <b303e412-1bdc-4658-adfe-2e7b03e908ef@intel.com> (raw)
In-Reply-To: <20260801122252.2476258-1-wanglu.priv@gmail.com>

Hi Wang,

Thanks for taking a look at cas,

On 8/1/2026 8:22 PM, Lu Wang wrote:
> A passive load-balance pass marks group_llc_balance as migrate_llc_task
> and queues active balance when it cannot move a task. The CPU stopper
> callback constructs a fresh lb_env, so preserve the migration type on
> the runqueue across the asynchronous boundary.
> 
> For CAS-directed active balance, reject a candidate whose preferred LLC
> does not match the destination LLC. This keeps the fallback from moving
> a task away from its preferred LLC.
> 

[ ... ]

>   static inline bool
>   migrate_degrades_llc(struct task_struct *p, struct lb_env *env)
>   {
> @@ -10796,7 +10813,7 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
>   	 * 4) too many balance attempts have failed.
>   	 */
>   	if (env->flags & LBF_ACTIVE_LB)
> -		return 1;
> +		return !migrate_llc_task_wrong_dst(p, env);
>   

When checking whether active load balance is needed in 
need_active_balance(),
alb_break_llc() is called to determine if the balance would break LLC 
locality
  (i.e., prevent a task from being migrated away from its preferred 
LLC). Later
in need_active_balance(), if LLC locality is not broken and the task is of
migrate_llc_task type, we force an active load balance. This means that 
once
active load balance reaches can_migrate_task(), we want it to always 
return true
- this helps the case where the task is the only running one on the 
src_cpu. Given
this logic, I do not see the need for the duplicated LLC-locality check in
can_migrate_task() for active load balance. Am I missing anything here?

thanks,
Chenyu

  reply	other threads:[~2026-08-03  4:20 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 [this message]
2026-08-03 10:02   ` Lu Wang
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=b303e412-1bdc-4658-adfe-2e7b03e908ef@intel.com \
    --to=yu.c.chen@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=tim.c.chen@linux.intel.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=wanglu.priv@gmail.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