mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Chen, Yu C" <yu.c.chen@intel.com>
To: Lu Wang <wanglu.priv@gmail.com>
Cc: <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>, <tim.c.chen@linux.intel.com>
Subject: Re: [PATCH v2] sched/cache: honor migrate_llc_task semantics in active load balance
Date: Tue, 11 Aug 2026 18:23:05 +0800	[thread overview]
Message-ID: <14f72439-d8f4-47aa-b3ce-6b8485ae46ea@intel.com> (raw)
In-Reply-To: <20260809105343.1189051-1-wanglu.priv@gmail.com>

On 8/9/2026 6:53 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 select the stopper callback when
> queueing active balance to preserve the migration semantics across the
> asynchronous boundary.
> 

Worthy adding a [Problem Statement] section to describe what issue this 
patch tries to fix
(with polish):
src_rq has two runnable tasks, p1 and p2. p1 prefers dst_rq (dst_llc), 
while p2 prefers
src_rq (src_llc). In this case, migrate_llc_task is set because src_rq 
has at least one task,
p1, that wants to migrate to dst_rq. In ALB, can_migrate_task() finds p2 
and returns true for
it, thus moving p2 out of its preferred LLC.

> 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.
> 
> Fixes: e4c9a4cb244a (\"sched/cache: Add migrate_llc_task migration type for cache-aware balancing\")
> Suggested-by: \"Chen, Yu C\" <yu.c.chen@intel.com>
> Signed-off-by: Lu Wang <wanglu.priv@gmail.com>
> ---
> Changes in v2:
>   - Select the stopper callback at kick time to preserve
>     migrate_llc_task semantics in active load balance without passing
>     migration_type across the stopper, which affects delayed-dequeue tasks.

Maybe move the above reasoning about why the new stopper function is needed
into the commit log for future reference.

> @@ -10645,6 +10646,20 @@ alb_break_llc(struct lb_env *env)
>   	return false;
>   }
>   
> +/*
> + * Returns true if p's preferred LLC does not match the destination CPU
> + * under migrate_llc_task semantics. Passive LB passes migrate_llc_task
> + * in migration_type, while active LB carries it in LBF_ACTIVE_LB_LLC.

"while active LB carries LBF_ACTIVE_LB_LLC in env->flags to avoid 
overwriting
env->migrate_type."

Per my understanding,

Reviewed-by: Chen Yu <yu.c.chen@intel.com>

thanks,
Chenyu


      parent reply	other threads:[~2026-08-11 10:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-01 12:22 [PATCH] " Lu Wang
2026-08-03  4:20 ` Chen, Yu C
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 15:07         ` Lu Wang
2026-08-04 19:42           ` Tim Chen
2026-08-05  2:38             ` wanglu15
2026-08-05 16:04               ` Tim Chen
2026-08-05 16:43                 ` Chen, Yu C
2026-08-06 16:21                   ` Tim Chen
2026-08-04  8:30       ` Lu Wang
2026-08-06 15:35 ` Chen, Yu C
2026-08-06 17:22   ` Tim Chen
2026-08-07  6:48     ` Chen, Yu C
2026-08-07  9:58       ` Lu Wang
2026-08-09 10:53 ` [PATCH v2] " Lu Wang
2026-08-10 20:56   ` Tim Chen
2026-08-11 10:23   ` Chen, Yu C [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=14f72439-d8f4-47aa-b3ce-6b8485ae46ea@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

Powered by JetHome