[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20260123100425.GJ171111@noisy.programming.kicks-ass.net>
Date: Fri, 23 Jan 2026 11:04:25 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Qiliang Yuan <realwujing@...il.com>
Cc: mingo@...hat.com, juri.lelli@...hat.com, vincent.guittot@...aro.org,
dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
mgorman@...e.de, vschneid@...hat.com, linux-kernel@...r.kernel.org,
Qiliang Yuan <yuanql9@...natelecom.cn>
Subject: Re: [PATCH] sched/fair: Optimize idle core discovery algorithm via
LLC-wide bitmask
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.
Powered by blists - more mailing lists