Re: [PATCH] riscv: Report dying CPU to RCU in IPI_CPU_STOP

From: Guo Ren

Date: Thu Dec 03 2026 - 21:21:03 EST


Hi Paul,

On Tue, Dec 1, 2026 at 9:42 AM Paul Walmsley <pjw@xxxxxxxxxx> wrote:
>
> On Mon, 22 Jun 2026, Guo Ren wrote:
>
> > From: "Guo Ren (Alibaba DAMO Academy)" <guoren@xxxxxxxxxx>
> >
> > This is a port of MIPS commit 9f3f3bdc6d9dac1 ("MIPS: smp: report
> > dying CPU to RCU in stop_this_cpu()") inspired by the Loongarch
> > mailing thread.
> >
> > The smp_send_stop() parks all secondary CPUs in IPI_CPU_STOP, which
> > marks the CPU offline for the scheduler via set_cpu_online(false),
> > but never informs RCU, so RCU keeps expecting a quiescent state
> > from CPUs that are now spinning forever with interrupts disabled.
> >
> > Please read the MIPS commit mentioned before for details.
>
> The MIPS commit message implies that this is a concern when
> arch_irq_work_has_interrupt() returns false. This only happens on RISC-V
> when !CONFIG_SMP. So I'm curious - were you able to observe the
> failure on RISC-V that was observed on MIPS?

Thanks for pointing this out. The patch was motivated by the MIPS and
LoongArch fixes, rather than an observed failure on RISC-V.

My concern was the consistency between the CPU's online state and
RCU's CPU-tracking state when a CPU is permanently stopped.

--
Best Regards
GUO Ren