Thread (41 messages) 41 messages, 7 authors, 2025-10-14
STALE236d

[PATCH v7 6/8] sched/topology: Unify tl_cls_mask() across core and x86

From: K Prateek Nayak <kprateek.nayak@amd.com>
Date: 2025-08-26 04:17:11
Also in: linux-s390, lkml
Subsystem: scheduler, the rest, x86 architecture (32-bit and 64-bit) · Maintainers: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot, Linus Torvalds, Thomas Gleixner, Borislav Petkov, Dave Hansen

Unify the tl_cls_mask() used by both the scheduler core and x86.
No functional changes intended.

Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
---
 arch/x86/kernel/smpboot.c      | 4 ----
 include/linux/sched/topology.h | 8 +++++++-
 kernel/sched/topology.c        | 7 -------
 3 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 03ff6270966a..81a40d777d65 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -470,10 +470,6 @@ static int x86_cluster_flags(void)
 {
 	return cpu_cluster_flags() | x86_sched_itmt_flags();
 }
-static const struct cpumask *tl_cls_mask(struct sched_domain_topology_level *tl, int cpu)
-{
-	return cpu_clustergroup_mask(cpu);
-}
 #endif
 
 #ifdef CONFIG_SCHED_MC
diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h
index d75fbb7d9667..e54501cc8e47 100644
--- a/include/linux/sched/topology.h
+++ b/include/linux/sched/topology.h
@@ -50,7 +50,13 @@ static inline int cpu_cluster_flags(void)
 {
 	return SD_CLUSTER | SD_SHARE_LLC;
 }
-#endif
+
+static const __maybe_unused
+struct cpumask *tl_cls_mask(struct sched_domain_topology_level *tl, int cpu)
+{
+	return cpu_clustergroup_mask(cpu);
+}
+#endif /* CONFIG_SCHED_CLUSTER */
 
 #ifdef CONFIG_SCHED_MC
 static inline int cpu_core_flags(void)
diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index 92165fe56a2d..4530cbad41e1 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -1724,13 +1724,6 @@ sd_init(struct sched_domain_topology_level *tl,
 	return sd;
 }
 
-#ifdef CONFIG_SCHED_CLUSTER
-static const struct cpumask *tl_cls_mask(struct sched_domain_topology_level *tl, int cpu)
-{
-	return cpu_clustergroup_mask(cpu);
-}
-#endif
-
 #ifdef CONFIG_SCHED_MC
 static const struct cpumask *tl_mc_mask(struct sched_domain_topology_level *tl, int cpu)
 {
-- 
2.34.1

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help