mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhan Xusheng <zhanxusheng1024@gmail.com>
To: tim.c.chen@linux.intel.com, peterz@infradead.org, mingo@redhat.com
Cc: yu.c.chen@intel.com, kayracizmeci@gmail.com,
	kprateek.nayak@amd.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, linux-kernel@vger.kernel.org,
	zhanxusheng@xiaomi.com
Subject: Re: [PATCH] sched/cache: Check reduced capacity before alb_break_llc()
Date: Sat, 31 Oct 2026 17:24:43 +0800	[thread overview]
Message-ID: <20261031092443.574996-1-zhanxusheng1024@gmail.com> (raw)
In-Reply-To: <93e3e1388b3d4512818e7f1e19003e0feb4890dd.camel@linux.intel.com>

Hi Tim,

On Fri, 2026-10-30 at 16:24 -0700, Tim Chen wrote:
> 1) There could be other idle CPUs in the preferred LLC. It would be
> better for the task to move to one of them, through the idle balance
> on those CPUs (via same reduced capacity check), than to move to a non-preferred LLC now.

Right.  With CPU1 idle and 60% IRQ load on CPU0, mainline moved the
task to CPU1 in all 4 runs.  With the patch it went to CPU2, in the
other LLC, in 2 of 4.

> 2) There could be ping pong migrations.  Cache aware scheduling could 
> move the task back to the CPU, because with only IRQ load on it, that
> CPU is considered idle. I think this would also need to be dealt with.
>
> Could you check nr_migrations in /proc/<pid>/sched, or trace
> sched_migrate_task, over the 20 seconds on your setup
> before and after your patch?  A run with 20% to 40% irq load would also help.

It does ping-pong.  nr_migrations of the busy thread in the 19 s after
its affinity is widened, CPU1 busy, one value per run:

  IRQ load  mainline      patched             iterations/s
  20%       2, 6, 8, 20   8, 11, 12, 13       4.2e7 -> 5.2e7
  40%       0, 2, 2, 10   5, 9, 16, 43        3.1e7 -> 5.1e7
  60%       0, 0, 0, 16   7 to 36 (7 runs),   1.9e7 -> 5.0e7
                          327 (1 run)

At 60% the extra migrations come in bursts of 0->2 and 2->0 round
trips about 4 ms apart.  A kprobe on __active_load_balance_cpu_stop
shows the 2->0 moves run with LBF_ACTIVE_LB_LLC, so they are the cache
aware pull back, and the 0->2 moves are this patch.

So the override needs both of your conditions: no idle CPU in the
preferred LLC with more capacity, and no pull back onto a CPU whose
capacity is reduced.  I'll work on a v2 along those lines.

Thanks,
Zhan Xusheng

      reply	other threads:[~2026-10-31  9:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29  2:36 Zhan Xusheng
2026-10-29  7:13 ` Kayra Cizmeci
2026-10-29  7:50   ` Zhan Xusheng
2026-10-29  8:13     ` Kayra Cizmeci
2026-10-29  8:18   ` Chen Yu
2026-10-29  8:18 ` Chen Yu
2026-10-29  8:55   ` Zhan Xusheng
2026-10-30 15:04     ` Chen Yu
2026-10-30 23:24 ` Tim Chen
2026-10-31  9:24   ` Zhan Xusheng [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=20261031092443.574996-1-zhanxusheng1024@gmail.com \
    --to=zhanxusheng1024@gmail.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=kayracizmeci@gmail.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 \
    --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®