Thread (13 messages) flat view 13 messages, 3 authors, 2024-11-08

Re: [PATCH v7 1/4] cpu/SMT: Provide a default topology_is_primary_thread()

From: Thomas Gleixner <hidden>
Date: 2024-10-30 14:55:19
Also in: linux-arm-kernel, lkml

On Wed, Oct 30 2024 at 20:54, Yicong Yang wrote:
 
+#ifndef topology_is_primary_thread
+#define topology_is_primary_thread topology_is_primary_thread
Please do not glue defines and functions together w/o a newline in between.
+static inline bool topology_is_primary_thread(unsigned int cpu)
+{
+	/*
+	 * On SMT hotplug the primary thread of the SMT won't be disabled.
+	 * Architectures do have a special primary thread (e.g. x86) need
+	 * to override this function. Otherwise just make the first thread
+	 * in the SMT as the primary thread.
+	 */
+	return cpu == cpumask_first(topology_sibling_cpumask(cpu));
How is that supposed to work? Assume both siblings are offline, then the
sibling mask is empty and you can't boot the CPU anymore.

Thanks,

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