[PATCH v2 2/3] cpu/hotplug: Weak fallback for arch_cpuhp_init_parallel_bringup

Jiaxun Yang posted 3 patches 1 year, 6 months ago
There is a newer version of this series
[PATCH v2 2/3] cpu/hotplug: Weak fallback for arch_cpuhp_init_parallel_bringup
Posted by Jiaxun Yang 1 year, 6 months ago
It is a general assumption that architectures entitled to parallel
bringup with CONFIG_HOTPLUG_PARALLEL do expect parallel bringup to
be available.

Provide a weak fallback arch_cpuhp_init_parallel_bringup function
to match this assumption.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 kernel/cpu.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index c89e0e91379a..16323610cd20 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1829,6 +1829,11 @@ static inline const struct cpumask *cpuhp_get_primary_thread_mask(void)
 }
 #endif
 
+bool __weak arch_cpuhp_init_parallel_bringup(void)
+{
+	return true;
+}
+
 /*
  * On architectures which have enabled parallel bringup this invokes all BP
  * prepare states for each of the to be onlined APs first. The last state

-- 
2.45.2
Re: [PATCH v2 2/3] cpu/hotplug: Weak fallback for arch_cpuhp_init_parallel_bringup
Posted by Thomas Gleixner 1 year, 6 months ago
On Mon, Jul 15 2024 at 21:35, Jiaxun Yang wrote:
> It is a general assumption that architectures entitled to parallel
> bringup with CONFIG_HOTPLUG_PARALLEL do expect parallel bringup to
> be available.

I can't parse that sentence.

> Provide a weak fallback arch_cpuhp_init_parallel_bringup function
> to match this assumption.

I assume you want to say something like this:

 CONFIG_HOTPLUG_PARALLEL expects the architecture to implement
 arch_cpuhp_init_parallel_bringup() to decide whether paralllel hotplug
 is possible and to do the necessary architecture specific
 initialization.

 There are architectures which can enable it unconditionally and do not
 require architecture specific initialization.

 Provide a wark fallback for arch_cpuhp_init_parallel_bringup() so that
 such architectures are not forced to implement empty stub functions.

Thanks,

        tglx