From: Jinjie Ruan <ruanjinjie@huawei.com>
To: <catalin.marinas@arm.com>, <will@kernel.org>,
<tsbogend@alpha.franken.de>, <tglx@kernel.org>,
<mingo@redhat.com>, <bp@alien8.de>, <dave.hansen@linux.intel.com>,
<hpa@zytor.com>, <peterz@infradead.org>, <kees@kernel.org>,
<nathan@kernel.org>, <linusw@kernel.org>, <ojeda@kernel.org>,
<david.kaplan@amd.com>, <lukas.bulwahn@redhat.com>,
<ryan.roberts@arm.com>, <maz@kernel.org>, <timothy.hayes@arm.com>,
<lpieralisi@kernel.org>, <thuth@redhat.com>,
<menglong8.dong@gmail.com>, <oupton@kernel.org>,
<yeoreum.yun@arm.com>, <miko.lenczewski@arm.com>,
<broonie@kernel.org>, <kevin.brodsky@arm.com>,
<james.clark@linaro.org>, <yangyicong@hisilicon.com>,
<tabba@google.com>, <osandov@fb.com>, <arnd@arndb.de>,
<anshuman.khandual@arm.com>, <david@kernel.org>,
<akpm@linux-foundation.org>, <ljs@kernel.org>, <dev.jain@arm.com>,
<yang@os.amperecomputing.com>, <chaitanyas.prakash@arm.com>,
<kprateek.nayak@amd.com>, <chenl311@chinatelecom.cn>,
<sshegde@linux.ibm.com>, <thorsten.blum@linux.dev>,
<chang.seok.bae@intel.com>, <tim.c.chen@linux.intel.com>,
<x86@kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mips@vger.kernel.org>
Subject: Re: [PATCH v3 12/12] arm64: Add HOTPLUG_PARALLEL support for secondary CPUs
Date: Tue, 7 Jul 2026 12:00:12 +0800 [thread overview]
Message-ID: <bddf7a68-7789-4ec2-819c-aaaee8173c70@huawei.com> (raw)
In-Reply-To: <20260624092537.2916971-13-ruanjinjie@huawei.com>
On 6/24/2026 5:25 PM, Jinjie Ruan wrote:
> Support for parallel secondary CPU bringup is already utilized by x86,
> MIPS and RISC-V. This patch brings this capability to the arm64
> architecture.
>
> To fully enable HOTPLUG_PARALLEL, this patch implements an arm64-specific
> arch_cpuhp_init_parallel_bringup() handler.
>
> In parallel bringup, early `set_cpu_present(cpu, 0)` inside
> cpu_die_early() removes the secondary CPU prematurely, causing the primary
> CPU's second-stage cpuhp_bringup_mask() sweep to skip it and drop
> failure logs.
Hi, Will,
In parallel bringup, cpu_die_early() calls set_cpu_present(cpu, 0),
which removes the failing secondary CPU from the mask. This causes the
primary CPU's cpuhp_bringup_mask() sweep to skip it and drop any failure
log.
Have you seen this before, and what do you think about the fix?
1830 */
1831 static bool __init cpuhp_bringup_cpus_parallel(unsigned int ncpus)
1832 {
1833 >-------const struct cpumask *mask = cpu_present_mask;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
1861 >-------/* Bring the not-yet started CPUs up */
1862 >-------cpuhp_bringup_mask(mask, ncpus, CPUHP_BP_KICK_AP);
^^^^^
1863 >-------cpuhp_bringup_mask(mask, ncpus, CPUHP_ONLINE);
^^^^^
Best regards,
Jinjie
>
> Remove this early unregistration from the secondary CPU, deferring the
> set_cpu_present(cpu, 0) call to the primary CPU's cleanup path to ensure
> robust parallel boot timeout detection.
>
> Tested natively with ATF on QEMU arm64 virt machine with 64 cores
> and also tested with KVM arm64 guest with 128 vCPUs.
>
> Tested-by: Michael Kelley <mhklinux@outlook.com>
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> ---
> arch/arm64/Kconfig | 2 +-
> arch/arm64/kernel/smp.c | 12 ++++++++++--
> 2 files changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 24496e9967a8..a9d8030e7492 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -231,7 +231,7 @@ config ARM64
> select HAVE_KPROBES
> select HAVE_KRETPROBES
> select HAVE_GENERIC_VDSO
> - select HOTPLUG_SPLIT_STARTUP if SMP
> + select HOTPLUG_PARALLEL if SMP
> select HOTPLUG_SMT if HOTPLUG_CPU
> select IRQ_DOMAIN
> select IRQ_FORCED_THREADING
> diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
> index 98ddbe50081d..a973b2d3bab1 100644
> --- a/arch/arm64/kernel/smp.c
> +++ b/arch/arm64/kernel/smp.c
> @@ -93,6 +93,15 @@ static inline int op_cpu_kill(unsigned int cpu)
> }
> #endif
>
> +extern const struct cpu_operations cpu_psci_ops;
> +
> +/* Establish whether parallel bringup can be supported. */
> +bool __init arch_cpuhp_init_parallel_bringup(void)
> +{
> + const struct cpu_operations *ops = get_secondary_cpu_ops();
> +
> + return ops == &cpu_psci_ops;
> +}
>
> /*
> * Boot a secondary CPU, and assign it the specified idle task.
> @@ -137,6 +146,7 @@ void arch_cpuhp_cleanup_kick_cpu(unsigned int cpu, bool is_alive)
> * We failed to synchronise with the CPU, so check if it left us
> * any breadcrumbs.
> */
> + set_cpu_present(cpu, 0);
> cpu_boot_data[cpu].task = NULL;
> status = READ_ONCE(cpu_boot_data[cpu].status);
> if (status == CPU_MMU_OFF)
> @@ -416,8 +426,6 @@ void __noreturn cpu_die_early(void)
>
> pr_crit("CPU%d: will not boot\n", cpu);
>
> - /* Mark this CPU absent */
> - set_cpu_present(cpu, 0);
> rcutree_report_cpu_dead();
>
> if (IS_ENABLED(CONFIG_HOTPLUG_CPU)) {
next prev parent reply other threads:[~2026-07-07 4:00 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-24 9:25 [PATCH v3 00/12] arm64: Add HOTPLUG_PARALLEL support for secondary CPUs Jinjie Ruan
2026-06-24 9:25 ` [PATCH v3 01/12] cpu/hotplug: Introduce CONFIG_HOTPLUG_PARALLEL_SMT Jinjie Ruan
2026-06-24 9:25 ` [PATCH v3 02/12] cpu/hotplug: Propagate bring-up status to arch_cpuhp_cleanup_kick_cpu() Jinjie Ruan
2026-06-24 9:25 ` [PATCH v3 03/12] arm64: smp: Tidy up smp_prepare_cpus() Jinjie Ruan
2026-06-24 9:25 ` [PATCH v3 04/12] arm64: smp: Tidy up cpuinfo init and cpufeature updates Jinjie Ruan
2026-06-24 9:25 ` [PATCH v3 05/12] arm64: smp: Defer RCU registration during secondary CPU bringup Jinjie Ruan
2026-07-06 17:39 ` Will Deacon
2026-07-07 3:02 ` Jinjie Ruan
2026-06-24 9:25 ` [PATCH v3 06/12] arm64: smp: Use generic HOTPLUG_SPLIT_STARTUP machinery for CPU onlining Jinjie Ruan
2026-06-24 9:25 ` [PATCH v3 07/12] arm64: cpu_ops: Make 'cpu_operations' pointer global instead of per-cpu Jinjie Ruan
2026-06-24 9:25 ` [PATCH v3 08/12] arm64: cpu_ops: Introduce get_secondary_cpu_ops() Jinjie Ruan
2026-06-24 9:25 ` [PATCH v3 09/12] arm64: cpufeature: Ensure atomic updates to system_cpucaps bitmap Jinjie Ruan
2026-07-06 17:40 ` Will Deacon
2026-07-07 3:24 ` Jinjie Ruan
2026-06-24 9:25 ` [PATCH v3 10/12] arm64: smp: Pass CPU ID to update_cpu_boot_status() Jinjie Ruan
2026-06-24 9:25 ` [PATCH v3 11/12] arm64: smp: Rework early boot data into per-CPU arrays Jinjie Ruan
2026-06-24 9:25 ` [PATCH v3 12/12] arm64: Add HOTPLUG_PARALLEL support for secondary CPUs Jinjie Ruan
2026-07-07 4:00 ` Jinjie Ruan [this message]
2026-06-24 12:16 ` [PATCH v3 00/12] " Will Deacon
2026-06-24 14:59 ` Borislav Petkov
2026-06-25 1:34 ` Jinjie Ruan
2026-07-06 17:39 ` Will Deacon
2026-06-29 4:04 ` Shrikanth Hegde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bddf7a68-7789-4ec2-819c-aaaee8173c70@huawei.com \
--to=ruanjinjie@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=anshuman.khandual@arm.com \
--cc=arnd@arndb.de \
--cc=bp@alien8.de \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=chaitanyas.prakash@arm.com \
--cc=chang.seok.bae@intel.com \
--cc=chenl311@chinatelecom.cn \
--cc=dave.hansen@linux.intel.com \
--cc=david.kaplan@amd.com \
--cc=david@kernel.org \
--cc=dev.jain@arm.com \
--cc=hpa@zytor.com \
--cc=james.clark@linaro.org \
--cc=kees@kernel.org \
--cc=kevin.brodsky@arm.com \
--cc=kprateek.nayak@amd.com \
--cc=linusw@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=ljs@kernel.org \
--cc=lpieralisi@kernel.org \
--cc=lukas.bulwahn@redhat.com \
--cc=maz@kernel.org \
--cc=menglong8.dong@gmail.com \
--cc=miko.lenczewski@arm.com \
--cc=mingo@redhat.com \
--cc=nathan@kernel.org \
--cc=ojeda@kernel.org \
--cc=osandov@fb.com \
--cc=oupton@kernel.org \
--cc=peterz@infradead.org \
--cc=ryan.roberts@arm.com \
--cc=sshegde@linux.ibm.com \
--cc=tabba@google.com \
--cc=tglx@kernel.org \
--cc=thorsten.blum@linux.dev \
--cc=thuth@redhat.com \
--cc=tim.c.chen@linux.intel.com \
--cc=timothy.hayes@arm.com \
--cc=tsbogend@alpha.franken.de \
--cc=will@kernel.org \
--cc=x86@kernel.org \
--cc=yang@os.amperecomputing.com \
--cc=yangyicong@hisilicon.com \
--cc=yeoreum.yun@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox