[tip: sched/core] sched/smp: Use the SMP version of idle_thread_set_boot_cpu()

tip-bot2 for Ingo Molnar posted 1 patch 3 months, 4 weeks ago
kernel/sched/core.c | 2 --
kernel/smpboot.c    | 4 ----
2 files changed, 6 deletions(-)
[tip: sched/core] sched/smp: Use the SMP version of idle_thread_set_boot_cpu()
Posted by tip-bot2 for Ingo Molnar 3 months, 4 weeks ago
The following commit has been merged into the sched/core branch of tip:

Commit-ID:     74063c1755ca990440a9c61c91bb7a873a40deeb
Gitweb:        https://git.kernel.org/tip/74063c1755ca990440a9c61c91bb7a873a40deeb
Author:        Ingo Molnar <mingo@kernel.org>
AuthorDate:    Wed, 28 May 2025 10:09:08 +02:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Fri, 13 Jun 2025 08:47:20 +02:00

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 <mingo@kernel.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Shrikanth Hegde <sshegde@linux.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Valentin Schneider <vschneid@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
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 fa89006..a03c3c1 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 1992b62..4503b60 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);