From 74063c1755ca990440a9c61c91bb7a873a40deeb Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Wed, 28 May 2025 10:09:08 +0200 Subject: [PATCH] sched/smp: Use the SMP version of idle_thread_set_boot_cpu() Simplify the scheduler by making the CONFIG_SMP=y version of idle_thread_set_boot_cpu() unconditional. Note that idle_thread_set_boot_cpu() is already conditional on CONFIG_GENERIC_SMP_IDLE_THREAD, which most architectures select unconditionally on both UP and SMP kernels. Signed-off-by: Ingo Molnar Acked-by: Peter Zijlstra Cc: Dietmar Eggemann Cc: Juri Lelli Cc: Linus Torvalds Cc: Mel Gorman Cc: Sebastian Andrzej Siewior Cc: Shrikanth Hegde Cc: Steven Rostedt Cc: Valentin Schneider Cc: Vincent Guittot Link: https://lore.kernel.org/r/20250528080924.2273858-28-mingo@kernel.org --- kernel/sched/core.c | 2 -- kernel/smpboot.c | 4 ---- 2 files changed, 6 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index fa89006e05e97..a03c3c1d7f50a 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -8582,9 +8582,7 @@ void __init sched_init(void) calc_load_update = jiffies + LOAD_FREQ; -#ifdef CONFIG_SMP idle_thread_set_boot_cpu(); -#endif balance_push_set(smp_processor_id(), false); init_sched_fair_class(); diff --git a/kernel/smpboot.c b/kernel/smpboot.c index 1992b62e980b7..4503b60ce9bd2 100644 --- a/kernel/smpboot.c +++ b/kernel/smpboot.c @@ -18,8 +18,6 @@ #include "smpboot.h" -#ifdef CONFIG_SMP - #ifdef CONFIG_GENERIC_SMP_IDLE_THREAD /* * For the hotplug case we keep the task structs around and reuse @@ -76,8 +74,6 @@ void __init idle_threads_init(void) } #endif -#endif /* #ifdef CONFIG_SMP */ - static LIST_HEAD(hotplug_threads); static DEFINE_MUTEX(smpboot_threads_lock); -- 2.47.2