aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/topology.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2025-05-28 10:09:01 +0200
committerIngo Molnar <mingo@kernel.org>2025-06-13 08:47:18 +0200
commitcac5cefbade90ff0bb0b393d301fa3b5234cf056 (patch)
tree15b5ff17d1801012f6c53498c6320cee6ef086f4 /kernel/sched/topology.c
parentsched/smp: Always define sched_domains_mutex_lock()/unlock(), def_root_domain... (diff)
downloadlinux-cac5cefbade90ff0bb0b393d301fa3b5234cf056.tar.gz
linux-cac5cefbade90ff0bb0b393d301fa3b5234cf056.zip
sched/smp: Make SMP unconditional
Simplify the scheduler by making CONFIG_SMP=y primitives and data structures unconditional. Introduce transitory wrappers for functionality not yet converted to SMP. Note that this patch is pretty large, because there's no clear separation between various aspects of the SMP scheduler, it's basically a huge block of #ifdef CONFIG_SMP. A fair amount of it has to be switched on for it to boot and work on UP systems. 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-21-mingo@kernel.org
Diffstat (limited to 'kernel/sched/topology.c')
-rw-r--r--kernel/sched/topology.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index ee347d9c5df4..f2c10167f2bc 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -17,8 +17,6 @@ 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;
@@ -1322,11 +1320,10 @@ next:
update_group_capacity(sd, cpu);
}
-#ifdef CONFIG_SMP
-
/* Update the "asym_prefer_cpu" when arch_asym_cpu_priority() changes. */
void sched_update_asym_prefer_cpu(int cpu, int old_prio, int new_prio)
{
+#ifdef CONFIG_SMP
int asym_prefer_cpu = cpu;
struct sched_domain *sd;
@@ -1376,9 +1373,8 @@ void sched_update_asym_prefer_cpu(int cpu, int old_prio, int new_prio)
WRITE_ONCE(sg->asym_prefer_cpu, asym_prefer_cpu);
}
-}
-
#endif /* CONFIG_SMP */
+}
/*
* Set of available CPUs grouped by their corresponding capacities
@@ -2844,5 +2840,3 @@ 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 */