public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Qiliang Yuan <realwujing@gmail.com>
Cc: 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, linux-kernel@vger.kernel.org,
	Qiliang Yuan <yuanql9@chinatelecom.cn>
Subject: Re: [PATCH] sched/fair: Optimize idle core discovery algorithm via LLC-wide bitmask
Date: Fri, 23 Jan 2026 11:04:25 +0100	[thread overview]
Message-ID: <20260123100425.GJ171111@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20260122152024.124979-1-realwujing@gmail.com>

On Thu, Jan 22, 2026 at 10:20:24AM -0500, Qiliang Yuan wrote:
> The current select_idle_cpu() employs a linear O(N) scan to find idle
> cores, which scales poorly on modern high-core-count systems.
> 
> This patch optimizes the discovery algorithm by:
> 1. Adding a per-LLC 'idle_cores_mask' to sched_domain_shared for
>    tracking core-level idle status.
> 2. Converting the linear search into an efficient bitmask iteration,
>    reducing typical search complexity towards O(1) in sparse scenarios.
> 3. Implementing a lazy-clear mechanism during the scan to maintain
>    efficiency without expensive global synchronization.
> 
> This algorithmic refinement minimizes the search space in the critical
> wakeup path, effectively mitigating linear scaling overhead on large
> SMT machines.

Since this is a performance patch; what is missing here is the actual
performance data.

This can be in the form of a micro-benchmark, or perf numbers showing
the improvement for this code-path.

Also, what kind of topologies have you tested this on; typically Intel
has a few very large LLC domains while AMD has more smaller ones.


      reply	other threads:[~2026-01-23 10:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-22 15:20 [PATCH] sched/fair: Optimize idle core discovery algorithm via LLC-wide bitmask Qiliang Yuan
2026-01-23 10:04 ` Peter Zijlstra [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=20260123100425.GJ171111@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=realwujing@gmail.com \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=yuanql9@chinatelecom.cn \
    /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