aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2025-05-28 10:09:00 +0200
committerIngo Molnar <mingo@kernel.org>2025-06-13 08:47:18 +0200
commit5202c25dd17c54cd4c21f266d9a51b644d7cd682 (patch)
treec3ac2f791d3db28be7958b517c1a0b01da9af77c
parentsched: Clean up and standardize #if/#else/#endif markers in sched/topology.c (diff)
downloadlinux-5202c25dd17c54cd4c21f266d9a51b644d7cd682.tar.gz
linux-5202c25dd17c54cd4c21f266d9a51b644d7cd682.zip
sched/smp: Always define sched_domains_mutex_lock()/unlock(), def_root_domain and sched_domains_mutex
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
-rw-r--r--include/linux/sched.h5
-rw-r--r--kernel/sched/build_utility.c3
-rw-r--r--kernel/sched/topology.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4f78a64beb52..aa54d75034ea 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -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;
diff --git a/kernel/sched/build_utility.c b/kernel/sched/build_utility.c
index bf9d8db94b70..5c485b2dfb95 100644
--- a/kernel/sched/build_utility.c
+++ b/kernel/sched/build_utility.c
@@ -83,9 +83,10 @@
#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
diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index 2352caf4f942..ee347d9c5df4 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -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 */