Skip to content

Commit 05fa29c

Browse files
committed
sched: Unify the SCHED_{SMT,CLUSTER,MC} Kconfig
JIRA: https://issues.redhat.com/browse/RHEL-118964 Conflicts: Dropped hunks for usupported architectures. Some context differences in other Kconfig files. commit 7bd291a Author: Peter Zijlstra <peterz@infradead.org> Date: Tue Aug 26 11:08:57 2025 +0200 sched: Unify the SCHED_{SMT,CLUSTER,MC} Kconfig Like many Kconfig symbols, SCHED_{SMT,CLUSTER,MC} are duplicated across arch/*/Kconfig. Try and clean up a little. Suggested-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Shrikanth Hegde <sshegde@linux.ibm.com> Tested-by: Shrikanth Hegde <sshegde@linux.ibm.com> # powerpc Link: https://lkml.kernel.org/r/20250826094358.GG3245006@noisy.programming.kicks-ass.net Signed-off-by: Phil Auld <pauld@redhat.com>
1 parent 6b6938e commit 05fa29c

File tree

5 files changed

+50
-64
lines changed

5 files changed

+50
-64
lines changed

arch/Kconfig

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,44 @@ config HOTPLUG_SMT
3333
config SMT_NUM_THREADS_DYNAMIC
3434
bool
3535

36+
config ARCH_SUPPORTS_SCHED_SMT
37+
bool
38+
39+
config ARCH_SUPPORTS_SCHED_CLUSTER
40+
bool
41+
42+
config ARCH_SUPPORTS_SCHED_MC
43+
bool
44+
45+
config SCHED_SMT
46+
bool "SMT (Hyperthreading) scheduler support"
47+
depends on ARCH_SUPPORTS_SCHED_SMT
48+
default y
49+
help
50+
Improves the CPU scheduler's decision making when dealing with
51+
MultiThreading at a cost of slightly increased overhead in some
52+
places. If unsure say N here.
53+
54+
config SCHED_CLUSTER
55+
bool "Cluster scheduler support"
56+
depends on ARCH_SUPPORTS_SCHED_CLUSTER
57+
default y
58+
help
59+
Cluster scheduler support improves the CPU scheduler's decision
60+
making when dealing with machines that have clusters of CPUs.
61+
Cluster usually means a couple of CPUs which are placed closely
62+
by sharing mid-level caches, last-level cache tags or internal
63+
busses.
64+
65+
config SCHED_MC
66+
bool "Multi-Core Cache (MC) scheduler support"
67+
depends on ARCH_SUPPORTS_SCHED_MC
68+
default y
69+
help
70+
Multi-core scheduler support improves the CPU scheduler's decision
71+
making when dealing with multi-core CPU chips at a cost of slightly
72+
increased overhead in some places. If unsure say N here.
73+
3674
# Selected by HOTPLUG_CORE_SYNC_DEAD or HOTPLUG_CORE_SYNC_FULL
3775
config HOTPLUG_CORE_SYNC
3876
bool

arch/arm64/Kconfig

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ config ARM64
9999
select ARCH_SUPPORTS_PER_VMA_LOCK
100100
select ARCH_SUPPORTS_HUGE_PFNMAP if TRANSPARENT_HUGEPAGE
101101
select ARCH_SUPPORTS_RT
102+
select ARCH_SUPPORTS_SCHED_SMT
103+
select ARCH_SUPPORTS_SCHED_CLUSTER
104+
select ARCH_SUPPORTS_SCHED_MC
102105
select ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
103106
select ARCH_WANT_COMPAT_IPC_PARSE_VERSION if COMPAT
104107
select ARCH_WANT_DEFAULT_BPF_JIT
@@ -1448,29 +1451,6 @@ config CPU_LITTLE_ENDIAN
14481451

14491452
endchoice
14501453

1451-
config SCHED_MC
1452-
bool "Multi-core scheduler support"
1453-
help
1454-
Multi-core scheduler support improves the CPU scheduler's decision
1455-
making when dealing with multi-core CPU chips at a cost of slightly
1456-
increased overhead in some places. If unsure say N here.
1457-
1458-
config SCHED_CLUSTER
1459-
bool "Cluster scheduler support"
1460-
help
1461-
Cluster scheduler support improves the CPU scheduler's decision
1462-
making when dealing with machines that have clusters of CPUs.
1463-
Cluster usually means a couple of CPUs which are placed closely
1464-
by sharing mid-level caches, last-level cache tags or internal
1465-
busses.
1466-
1467-
config SCHED_SMT
1468-
bool "SMT scheduler support"
1469-
help
1470-
Improves the CPU scheduler's decision making when dealing with
1471-
MultiThreading at a cost of slightly increased overhead in some
1472-
places. If unsure say N here.
1473-
14741454
config NR_CPUS
14751455
int "Maximum number of CPUs (2-4096)"
14761456
range 2 4096

arch/powerpc/Kconfig

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ config PPC
146146
select ARCH_STACKWALK
147147
select ARCH_SUPPORTS_ATOMIC_RMW
148148
select ARCH_SUPPORTS_DEBUG_PAGEALLOC if PPC_BOOK3S || PPC_8xx || 40x
149+
select ARCH_SUPPORTS_SCHED_MC if SMP
150+
select ARCH_SUPPORTS_SCHED_SMT if PPC64 && SMP
151+
select SCHED_MC if ARCH_SUPPORTS_SCHED_MC
149152
select ARCH_USE_BUILTIN_BSWAP
150153
select ARCH_USE_CMPXCHG_LOCKREF if PPC64
151154
select ARCH_USE_MEMTEST
@@ -845,18 +848,6 @@ config PPC_PROT_SAO_LPAR
845848
config PPC_COPRO_BASE
846849
bool
847850

848-
config SCHED_SMT
849-
bool "SMT (Hyperthreading) scheduler support"
850-
depends on PPC64 && SMP
851-
help
852-
SMT scheduler support improves the CPU scheduler's decision making
853-
when dealing with POWER5 cpus at a cost of slightly increased
854-
overhead in some places. If unsure say N here.
855-
856-
config SCHED_MC
857-
def_bool y
858-
depends on SMP
859-
860851
config PPC_DENORMALISATION
861852
bool "PowerPC denormalisation exception handling"
862853
depends on PPC_BOOK3S_64

arch/s390/Kconfig

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -499,15 +499,11 @@ config NODES_SHIFT
499499
depends on NUMA
500500
default "1"
501501

502-
config SCHED_SMT
503-
def_bool n
504-
505-
config SCHED_MC
506-
def_bool n
507-
508502
config SCHED_TOPOLOGY
509503
def_bool y
510504
prompt "Topology scheduler support"
505+
select ARCH_SUPPORTS_SCHED_SMT
506+
select ARCH_SUPPORTS_SCHED_MC
511507
select SCHED_SMT
512508
select SCHED_MC
513509
help

arch/x86/Kconfig

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,10 @@ config X86
308308
select FUNCTION_ALIGNMENT_4B
309309
imply IMA_SECURE_AND_OR_TRUSTED_BOOT if EFI
310310
select HAVE_DYNAMIC_FTRACE_NO_PATCHABLE
311+
select ARCH_SUPPORTS_SCHED_SMT if SMP
312+
select SCHED_SMT if SMP
313+
select ARCH_SUPPORTS_SCHED_CLUSTER if SMP
314+
select ARCH_SUPPORTS_SCHED_MC if SMP
311315

312316
config INSTRUCTION_DECODER
313317
def_bool y
@@ -1030,29 +1034,6 @@ config NR_CPUS
10301034
This is purely to save memory: each supported CPU adds about 8KB
10311035
to the kernel image.
10321036

1033-
config SCHED_CLUSTER
1034-
bool "Cluster scheduler support"
1035-
depends on SMP
1036-
default y
1037-
help
1038-
Cluster scheduler support improves the CPU scheduler's decision
1039-
making when dealing with machines that have clusters of CPUs.
1040-
Cluster usually means a couple of CPUs which are placed closely
1041-
by sharing mid-level caches, last-level cache tags or internal
1042-
busses.
1043-
1044-
config SCHED_SMT
1045-
def_bool y if SMP
1046-
1047-
config SCHED_MC
1048-
def_bool y
1049-
prompt "Multi-core scheduler support"
1050-
depends on SMP
1051-
help
1052-
Multi-core scheduler support improves the CPU scheduler's decision
1053-
making when dealing with multi-core CPU chips at a cost of slightly
1054-
increased overhead in some places. If unsure say N here.
1055-
10561037
config SCHED_MC_PRIO
10571038
bool "CPU core priorities scheduler support"
10581039
depends on SCHED_MC && CPU_SUP_INTEL

0 commit comments

Comments
 (0)