[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240705-loongarch-hotplug-v1-1-67d9c4709aa9@flygoat.com>
Date: Fri, 05 Jul 2024 11:29:37 +0800
From: Jiaxun Yang <jiaxun.yang@...goat.com>
To: Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>, Huacai Chen <chenhuacai@...nel.org>,
WANG Xuerui <kernel@...0n.name>
Cc: linux-kernel@...r.kernel.org, loongarch@...ts.linux.dev,
Jiaxun Yang <jiaxun.yang@...goat.com>
Subject: [PATCH 1/3] cpu/hotplug: Make HOTPLUG_PARALLEL independent of
HOTPLUG_SMT
Use ifdef to guard reference to HOTPLUG_SMT symbols so HOTPLUG_PARALLEL
can be enabled without HOTPLUG_SMT being selected.
Signed-off-by: Jiaxun Yang <jiaxun.yang@...goat.com>
---
kernel/cpu.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 1209ddaec026..2ab3f68a1bb1 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1808,6 +1808,7 @@ static int __init parallel_bringup_parse_param(char *arg)
}
early_param("cpuhp.parallel", parallel_bringup_parse_param);
+#ifdef CONFIG_HOTPLUG_SMT
static inline bool cpuhp_smt_aware(void)
{
return cpu_smt_max_threads > 1;
@@ -1817,6 +1818,7 @@ static inline const struct cpumask *cpuhp_get_primary_thread_mask(void)
{
return cpu_primary_thread_mask;
}
+#endif
/*
* On architectures which have enabled parallel bringup this invokes all BP
@@ -1837,6 +1839,7 @@ static bool __init cpuhp_bringup_cpus_parallel(unsigned int ncpus)
if (!__cpuhp_parallel_bringup)
return false;
+#ifdef CONFIG_HOTPLUG_SMT
if (cpuhp_smt_aware()) {
const struct cpumask *pmask = cpuhp_get_primary_thread_mask();
static struct cpumask tmp_mask __initdata;
@@ -1857,6 +1860,7 @@ static bool __init cpuhp_bringup_cpus_parallel(unsigned int ncpus)
cpumask_andnot(&tmp_mask, mask, pmask);
mask = &tmp_mask;
}
+#endif
/* Bring the not-yet started CPUs up */
cpuhp_bringup_mask(mask, ncpus, CPUHP_BP_KICK_AP);
--
2.45.2
Powered by blists - more mailing lists