Re: [PATCH v2 0/3] sched: Simplify ifdeffery around CONFIG_SCHED_SMT
From: Valentin Schneider
Date: Tue May 12 2026 - 14:12:21 EST
On 12/05/26 20:51, Shrikanth Hegde wrote:
> Semantics
> =========
> - For CONFIG_SCHED_SMT=y:
> No functional change.
> - For CONFIG_SCHED_SMT=n:
> - cpu_smt_mask(cpu) becomes cpumask_of(cpu), effectively making it
> per CPU with no siblings.
> - sched_smt_present remains defined, but never becomes active:
> Since cpumask_weight(cpumask_of(cpu)) == 1
>
> Performance impact
> ==================
> - CONFIG_SCHED_SMT=y:
> No change in generated code.
> - CONFIG_SCHED_SMT=n:
> - Small increase in text size (~0.01%) due to removal of compile-time
> stubs. Most paths remain effectively dead due to static keys.
> - Fast paths are protected using IS_ENABLED(CONFIG_SCHED_SMT).
>
> With that, cpu_smt_mask() to be used unconditionally and reduces
> CONFIG_SCHED_SMT-specific code paths, improving readability and
> maintainability.
>
> This leaves the remaining use of CONFIG_SCHED_SMT mainly for topology
> handling bits.
>
Reviewed-by: Valentin Schneider <vschneid@xxxxxxxxxx>