Re: [PATCH 0/3] sched: Simplify ifdeffery around CONFIG_SCHED_SMT

From: Valentin Schneider

Date: Tue May 12 2026 - 07:01:57 EST


On 06/05/26 16:30, Shrikanth Hegde wrote:
> Plus, Major distros make CONFIG_SCHED_SMT=y for all major
> archs and few archs unconditionally make CONFIG_SCHED_SMT=y (x86,
> s390), So CONFIG_SCHED_SMT=n is a rare case.
>

That leaves only a handful of #ifdefs:

include/linux/sched/topology.h:35:2:#ifdef CONFIG_SCHED_SMT
kernel/sched/topology.c:1757:2:#ifdef CONFIG_SCHED_SMT
kernel/sched/topology.c:1802:2:#ifdef CONFIG_SCHED_SMT
arch/powerpc/kernel/smp.c:986:2:#ifdef CONFIG_SCHED_SMT
arch/powerpc/kernel/smp.c:1038:2:#ifdef CONFIG_SCHED_SMT
arch/powerpc/kernel/smp.c:1720:2:#ifdef CONFIG_SCHED_SMT
arch/powerpc/include/asm/smp.h:141:2:#ifdef CONFIG_SCHED_SMT

The topology code could deal with unconditionally building an SMT layer as
it'll just get degenerated. The powerpc usage is mostly topology and
cpu_smt_mask(). So if we want to push for it, we could even get rid of the
config entirely.