Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+60 -145
+38
arch/Kconfig
··· 41 41 config SMT_NUM_THREADS_DYNAMIC 42 42 bool 43 43 44 + config ARCH_SUPPORTS_SCHED_SMT 45 + bool 46 + 47 + config ARCH_SUPPORTS_SCHED_CLUSTER 48 + bool 49 + 50 + config ARCH_SUPPORTS_SCHED_MC 51 + bool 52 + 53 + config SCHED_SMT 54 + bool "SMT (Hyperthreading) scheduler support" 55 + depends on ARCH_SUPPORTS_SCHED_SMT 56 + default y 57 + help 58 + Improves the CPU scheduler's decision making when dealing with 59 + MultiThreading at a cost of slightly increased overhead in some 60 + places. If unsure say N here. 61 + 62 + config SCHED_CLUSTER 63 + bool "Cluster scheduler support" 64 + depends on ARCH_SUPPORTS_SCHED_CLUSTER 65 + default y 66 + help 67 + Cluster scheduler support improves the CPU scheduler's decision 68 + making when dealing with machines that have clusters of CPUs. 69 + Cluster usually means a couple of CPUs which are placed closely 70 + by sharing mid-level caches, last-level cache tags or internal 71 + busses. 72 + 73 + config SCHED_MC 74 + bool "Multi-Core Cache (MC) scheduler support" 75 + depends on ARCH_SUPPORTS_SCHED_MC 76 + default y 77 + help 78 + Multi-core scheduler support improves the CPU scheduler's decision 79 + making when dealing with multi-core CPU chips at a cost of slightly 80 + increased overhead in some places. If unsure say N here. 81 + 44 82 # Selected by HOTPLUG_CORE_SYNC_DEAD or HOTPLUG_CORE_SYNC_FULL 45 83 config HOTPLUG_CORE_SYNC 46 84 bool
+2 -16
arch/arm/Kconfig
··· 941 941 config ARM_CPU_TOPOLOGY 942 942 bool "Support cpu topology definition" 943 943 depends on SMP && CPU_V7 944 + select ARCH_SUPPORTS_SCHED_MC 945 + select ARCH_SUPPORTS_SCHED_SMT 944 946 default y 945 947 help 946 948 Support ARM cpu topology definition. The MPIDR register defines 947 949 affinity between processors which is then used to describe the cpu 948 950 topology of an ARM System. 949 - 950 - config SCHED_MC 951 - bool "Multi-core scheduler support" 952 - depends on ARM_CPU_TOPOLOGY 953 - help 954 - Multi-core scheduler support improves the CPU scheduler's decision 955 - making when dealing with multi-core CPU chips at a cost of slightly 956 - increased overhead in some places. If unsure say N here. 957 - 958 - config SCHED_SMT 959 - bool "SMT scheduler support" 960 - depends on ARM_CPU_TOPOLOGY 961 - help 962 - Improves the CPU scheduler's decision making when dealing with 963 - MultiThreading at a cost of slightly increased overhead in some 964 - places. If unsure say N here. 965 951 966 952 config HAVE_ARM_SCU 967 953 bool
+3 -23
arch/arm64/Kconfig
··· 108 108 select ARCH_SUPPORTS_PER_VMA_LOCK 109 109 select ARCH_SUPPORTS_HUGE_PFNMAP if TRANSPARENT_HUGEPAGE 110 110 select ARCH_SUPPORTS_RT 111 + select ARCH_SUPPORTS_SCHED_SMT 112 + select ARCH_SUPPORTS_SCHED_CLUSTER 113 + select ARCH_SUPPORTS_SCHED_MC 111 114 select ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH 112 115 select ARCH_WANT_COMPAT_IPC_PARSE_VERSION if COMPAT 113 116 select ARCH_WANT_DEFAULT_BPF_JIT ··· 1507 1504 This is usually the case for distributions targeting arm64. 1508 1505 1509 1506 endchoice 1510 - 1511 - config SCHED_MC 1512 - bool "Multi-core scheduler support" 1513 - help 1514 - Multi-core scheduler support improves the CPU scheduler's decision 1515 - making when dealing with multi-core CPU chips at a cost of slightly 1516 - increased overhead in some places. If unsure say N here. 1517 - 1518 - config SCHED_CLUSTER 1519 - bool "Cluster scheduler support" 1520 - help 1521 - Cluster scheduler support improves the CPU scheduler's decision 1522 - making when dealing with machines that have clusters of CPUs. 1523 - Cluster usually means a couple of CPUs which are placed closely 1524 - by sharing mid-level caches, last-level cache tags or internal 1525 - busses. 1526 - 1527 - config SCHED_SMT 1528 - bool "SMT scheduler support" 1529 - help 1530 - Improves the CPU scheduler's decision making when dealing with 1531 - MultiThreading at a cost of slightly increased overhead in some 1532 - places. If unsure say N here. 1533 1507 1534 1508 config NR_CPUS 1535 1509 int "Maximum number of CPUs (2-4096)"
+2 -17
arch/loongarch/Kconfig
··· 70 70 select ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS 71 71 select ARCH_SUPPORTS_NUMA_BALANCING 72 72 select ARCH_SUPPORTS_RT 73 + select ARCH_SUPPORTS_SCHED_SMT if SMP 74 + select ARCH_SUPPORTS_SCHED_MC if SMP 73 75 select ARCH_USE_BUILTIN_BSWAP 74 76 select ARCH_USE_CMPXCHG_LOCKREF 75 77 select ARCH_USE_MEMTEST ··· 449 447 help 450 448 This kernel feature allows the kernel to be loaded directly by 451 449 EFI firmware without the use of a bootloader. 452 - 453 - config SCHED_SMT 454 - bool "SMT scheduler support" 455 - depends on SMP 456 - default y 457 - help 458 - Improves scheduler's performance when there are multiple 459 - threads in one physical core. 460 - 461 - config SCHED_MC 462 - bool "Multi-core scheduler support" 463 - depends on SMP 464 - default y 465 - help 466 - Multi-core scheduler support improves the CPU scheduler's decision 467 - making when dealing with multi-core CPU chips at a cost of slightly 468 - increased overhead in some places. 469 450 470 451 config SMP 471 452 bool "Multi-Processing support"
+2 -14
arch/mips/Kconfig
··· 2223 2223 select SMP 2224 2224 select SMP_UP 2225 2225 select SYS_SUPPORTS_SMP 2226 - select SYS_SUPPORTS_SCHED_SMT 2226 + select ARCH_SUPPORTS_SCHED_SMT 2227 2227 select MIPS_PERF_SHARED_TC_COUNTERS 2228 2228 help 2229 2229 This is a kernel model which is known as SMVP. This is supported ··· 2233 2233 <http://www.imgtec.com/mips/mips-multithreading.asp>. 2234 2234 2235 2235 config MIPS_MT 2236 - bool 2237 - 2238 - config SCHED_SMT 2239 - bool "SMT (multithreading) scheduler support" 2240 - depends on SYS_SUPPORTS_SCHED_SMT 2241 - default n 2242 - help 2243 - SMT scheduler support improves the CPU scheduler's decision making 2244 - when dealing with MIPS MT enabled cores at a cost of slightly 2245 - increased overhead in some places. If unsure say N here. 2246 - 2247 - config SYS_SUPPORTS_SCHED_SMT 2248 2236 bool 2249 2237 2250 2238 config SYS_SUPPORTS_MULTITHREADING ··· 2306 2318 select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU 2307 2319 select SYNC_R4K if (CEVT_R4K || CSRC_R4K) 2308 2320 select SYS_SUPPORTS_HOTPLUG_CPU 2309 - select SYS_SUPPORTS_SCHED_SMT if CPU_MIPSR6 2321 + select ARCH_SUPPORTS_SCHED_SMT if CPU_MIPSR6 2310 2322 select SYS_SUPPORTS_SMP 2311 2323 select WEAK_ORDERING 2312 2324 select GENERIC_IRQ_MIGRATION if HOTPLUG_CPU
+1 -8
arch/parisc/Kconfig
··· 44 44 select ARCH_HAVE_NMI_SAFE_CMPXCHG 45 45 select GENERIC_SMP_IDLE_THREAD 46 46 select GENERIC_ARCH_TOPOLOGY if SMP 47 + select ARCH_SUPPORTS_SCHED_MC if SMP && PA8X00 47 48 select GENERIC_CPU_DEVICES if !SMP 48 49 select GENERIC_LIB_DEVMEM_IS_ALLOWED 49 50 select SYSCTL_ARCH_UNALIGN_ALLOW ··· 319 318 available at <https://www.tldp.org/docs.html#howto>. 320 319 321 320 If you don't know what to do here, say N. 322 - 323 - config SCHED_MC 324 - bool "Multi-core scheduler support" 325 - depends on GENERIC_ARCH_TOPOLOGY && PA8X00 326 - help 327 - Multi-core scheduler support improves the CPU scheduler's decision 328 - making when dealing with multi-core CPU chips at a cost of slightly 329 - increased overhead in some places. If unsure say N here. 330 321 331 322 config IRQSTACKS 332 323 bool "Use separate kernel stacks when processing interrupts"
+3 -12
arch/powerpc/Kconfig
··· 170 170 select ARCH_STACKWALK 171 171 select ARCH_SUPPORTS_ATOMIC_RMW 172 172 select ARCH_SUPPORTS_DEBUG_PAGEALLOC if PPC_BOOK3S || PPC_8xx 173 + select ARCH_SUPPORTS_SCHED_MC if SMP 174 + select ARCH_SUPPORTS_SCHED_SMT if PPC64 && SMP 175 + select SCHED_MC if ARCH_SUPPORTS_SCHED_MC 173 176 select ARCH_USE_BUILTIN_BSWAP 174 177 select ARCH_USE_CMPXCHG_LOCKREF if PPC64 175 178 select ARCH_USE_MEMTEST ··· 965 962 966 963 config PPC_COPRO_BASE 967 964 bool 968 - 969 - config SCHED_SMT 970 - bool "SMT (Hyperthreading) scheduler support" 971 - depends on PPC64 && SMP 972 - help 973 - SMT scheduler support improves the CPU scheduler's decision making 974 - when dealing with POWER5 cpus at a cost of slightly increased 975 - overhead in some places. If unsure say N here. 976 - 977 - config SCHED_MC 978 - def_bool y 979 - depends on SMP 980 965 981 966 config PPC_DENORMALISATION 982 967 bool "PowerPC denormalisation exception handling"
+1 -8
arch/riscv/Kconfig
··· 72 72 select ARCH_SUPPORTS_PER_VMA_LOCK if MMU 73 73 select ARCH_SUPPORTS_RT 74 74 select ARCH_SUPPORTS_SHADOW_CALL_STACK if HAVE_SHADOW_CALL_STACK 75 + select ARCH_SUPPORTS_SCHED_MC if SMP 75 76 select ARCH_USE_CMPXCHG_LOCKREF if 64BIT 76 77 select ARCH_USE_MEMTEST 77 78 select ARCH_USE_QUEUED_RWLOCKS ··· 453 452 here. 454 453 455 454 If you don't know what to do here, say N. 456 - 457 - config SCHED_MC 458 - bool "Multi-core scheduler support" 459 - depends on SMP 460 - help 461 - Multi-core scheduler support improves the CPU scheduler's decision 462 - making when dealing with multi-core CPU chips at a cost of slightly 463 - increased overhead in some places. If unsure say N here. 464 455 465 456 config NR_CPUS 466 457 int "Maximum number of CPUs (2-512)"
+2 -6
arch/s390/Kconfig
··· 547 547 depends on NUMA 548 548 default "1" 549 549 550 - config SCHED_SMT 551 - def_bool n 552 - 553 - config SCHED_MC 554 - def_bool n 555 - 556 550 config SCHED_TOPOLOGY 557 551 def_bool y 558 552 prompt "Topology scheduler support" 553 + select ARCH_SUPPORTS_SCHED_SMT 554 + select ARCH_SUPPORTS_SCHED_MC 559 555 select SCHED_SMT 560 556 select SCHED_MC 561 557 help
+2 -18
arch/sparc/Kconfig
··· 110 110 select HAVE_SETUP_PER_CPU_AREA 111 111 select NEED_PER_CPU_EMBED_FIRST_CHUNK 112 112 select NEED_PER_CPU_PAGE_FIRST_CHUNK 113 + select ARCH_SUPPORTS_SCHED_SMT if SMP 114 + select ARCH_SUPPORTS_SCHED_MC if SMP 113 115 114 116 config ARCH_PROC_KCORE_TEXT 115 117 def_bool y ··· 289 287 if SPARC64 || COMPILE_TEST 290 288 source "kernel/power/Kconfig" 291 289 endif 292 - 293 - config SCHED_SMT 294 - bool "SMT (Hyperthreading) scheduler support" 295 - depends on SPARC64 && SMP 296 - default y 297 - help 298 - SMT scheduler support improves the CPU scheduler's decision making 299 - when dealing with SPARC cpus at a cost of slightly increased overhead 300 - in some places. If unsure say N here. 301 - 302 - config SCHED_MC 303 - bool "Multi-core scheduler support" 304 - depends on SPARC64 && SMP 305 - default y 306 - help 307 - Multi-core scheduler support improves the CPU scheduler's decision 308 - making when dealing with multi-core CPU chips at a cost of slightly 309 - increased overhead in some places. If unsure say N here. 310 290 311 291 config CMDLINE_BOOL 312 292 bool "Default bootloader kernel arguments"
+4 -23
arch/x86/Kconfig
··· 330 330 imply IMA_SECURE_AND_OR_TRUSTED_BOOT if EFI 331 331 select HAVE_DYNAMIC_FTRACE_NO_PATCHABLE 332 332 select ARCH_SUPPORTS_PT_RECLAIM if X86_64 333 + select ARCH_SUPPORTS_SCHED_SMT if SMP 334 + select SCHED_SMT if SMP 335 + select ARCH_SUPPORTS_SCHED_CLUSTER if SMP 336 + select ARCH_SUPPORTS_SCHED_MC if SMP 333 337 334 338 config INSTRUCTION_DECODER 335 339 def_bool y ··· 1034 1030 1035 1031 This is purely to save memory: each supported CPU adds about 8KB 1036 1032 to the kernel image. 1037 - 1038 - config SCHED_CLUSTER 1039 - bool "Cluster scheduler support" 1040 - depends on SMP 1041 - default y 1042 - help 1043 - Cluster scheduler support improves the CPU scheduler's decision 1044 - making when dealing with machines that have clusters of CPUs. 1045 - Cluster usually means a couple of CPUs which are placed closely 1046 - by sharing mid-level caches, last-level cache tags or internal 1047 - busses. 1048 - 1049 - config SCHED_SMT 1050 - def_bool y if SMP 1051 - 1052 - config SCHED_MC 1053 - def_bool y 1054 - prompt "Multi-core scheduler support" 1055 - depends on SMP 1056 - help 1057 - Multi-core scheduler support improves the CPU scheduler's decision 1058 - making when dealing with multi-core CPU chips at a cost of slightly 1059 - increased overhead in some places. If unsure say N here. 1060 1033 1061 1034 config SCHED_MC_PRIO 1062 1035 bool "CPU core priorities scheduler support"