]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sched/smp: Always define sched_domains_mutex_lock()/unlock(), def_root_domain and...
authorIngo Molnar <mingo@kernel.org>
Wed, 28 May 2025 08:09:00 +0000 (10:09 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 13 Jun 2025 06:47:18 +0000 (08:47 +0200)
Simplify the scheduler by making CONFIG_SMP=y primitives and data
structures unconditional.

Unconditionally build kernel/sched/topology.c and the main sched-domains
locking primitives.

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-20-mingo@kernel.org
include/linux/sched.h
kernel/sched/build_utility.c
kernel/sched/topology.c

index 4f78a64beb52c425e46c66427b2f608ba30b3d99..aa54d75034ea2e43014441fdbe04875ee30885ed 100644 (file)
@@ -395,15 +395,10 @@ enum uclamp_id {
        UCLAMP_CNT
 };
 
-#ifdef CONFIG_SMP
 extern struct root_domain def_root_domain;
 extern struct mutex sched_domains_mutex;
 extern void sched_domains_mutex_lock(void);
 extern void sched_domains_mutex_unlock(void);
-#else
-static inline void sched_domains_mutex_lock(void) { }
-static inline void sched_domains_mutex_unlock(void) { }
-#endif
 
 struct sched_param {
        int sched_priority;
index bf9d8db94b7000ec296e9273965c19cba2f987aa..5c485b2dfb9597983426c0b5291870d9dd08affa 100644 (file)
 #ifdef CONFIG_SMP
 # include "cpupri.c"
 # include "stop_task.c"
-# include "topology.c"
 #endif
 
+#include "topology.c"
+
 #ifdef CONFIG_SCHED_CORE
 # include "core_sched.c"
 #endif
index 2352caf4f94258c1892836e6cff438824757d752..ee347d9c5df43b5badf2f02746de879559ebd94f 100644 (file)
@@ -17,6 +17,8 @@ void sched_domains_mutex_unlock(void)
        mutex_unlock(&sched_domains_mutex);
 }
 
+#ifdef CONFIG_SMP
+
 /* Protected by sched_domains_mutex: */
 static cpumask_var_t sched_domains_tmpmask;
 static cpumask_var_t sched_domains_tmpmask2;
@@ -2842,3 +2844,5 @@ void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
        partition_sched_domains_locked(ndoms_new, doms_new, dattr_new);
        sched_domains_mutex_unlock();
 }
+
+#endif /* CONFIG_SMP */