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

Re: [PATCH v7 5/8] sched/topology: Unify tl_smt_mask() across core and all arch

From: Peter Zijlstra <peterz@infradead.org>
Date: 2025-08-26 08:24:38
Also in: linux-s390, lkml

On Tue, Aug 26, 2025 at 10:11:40AM +0200, Christophe Leroy wrote:

Le 26/08/2025 à 10:01, Peter Zijlstra a écrit :
quoted
quoted
diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h
index 602508130c8a..d75fbb7d9667 100644
--- a/include/linux/sched/topology.h
+++ b/include/linux/sched/topology.h
@@ -37,7 +37,13 @@ static inline int cpu_smt_flags(void)
  {
  	return SD_SHARE_CPUCAPACITY | SD_SHARE_LLC;
  }
-#endif
+
+static const __maybe_unused
+struct cpumask *tl_smt_mask(struct sched_domain_topology_level *tl, int cpu)
+{
+	return cpu_smt_mask(cpu);
+}
+#endif /* CONFIG_SCHED_SMT */
Problem with that __maybe_unused is that you forgot inline.

static inline const
struct cpumask *tl_smt_mask(struct sched_domain_topology_level *tl, int cpu)
{
	return cpu_smt_mask(cpu);
}

seems to make it happy.
But the function is referenced by SDTL_INIT() macro so there is no real
point in declaring it inline. Would be cleaner to have it defined in a C
file.
Ah, that's what you mean. I was more focussed on getting rid of that
horrible __maybe_unused and then either works. But yes, perhaps just
having them in a .c file is best.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help