Re: [PATCH] MIPS: smp: report dying CPU to RCU in stop_this_cpu()
From: Huacai Chen
Date: Fri Jun 05 2026 - 10:09:04 EST
On Fri, Jun 5, 2026 at 3:28 PM Jonas Jelonek <jelonek.jonas@xxxxxxxxx> wrote:
>
> Hi Sebastian,
>
> I'm not an expert in this area so please correct me if some claim or
> explanation is wrong.
>
> On 05.06.26 08:42, Sebastian Andrzej Siewior wrote:
> > On 2026-06-04 18:24:07 [+0000], Jonas Jelonek wrote:
> > …
> >> This issue popped up during kernel bump downstream in OpenWrt from
> >> 6.18.33 to 6.18.34, since the suspected change has been backported to
> >> 6.18 stable branch [1].
> > I would avoid the link and simply write after the backport of the patch
> > or so.
>
> Fine with that, I can adjust that in a v2.
>
> >> Call rcutree_report_cpu_dead() once interrupts are disabled, mirroring the
> >> generic CPU-hotplug offline path (and arm64's stop handling), so RCU stops
> >> waiting on the parked CPUs and grace periods can still complete.
> > This is part of cpuhp_report_idle_dead(). Is it now invoked twice? Or is
> > something else missing/ different?
>
> Those seem to be two different paths. To be honest I'm not confident
> under which circumstances which of those paths is used to take down
> a CPU. In my case, issuing a reboot command reaches smp_send_stop()
> where the issue explained in the patch message then happens.
I think I know the reason. Halt/poweroff/reboot doesn't call cpu
hotplug functions to disable non-boot cpus, instead it only calls
migrate_to_reboot_cpu() and then goto the arch-specific code. And
arch-specific code also doesn't call cpu hotplug functions, it only
calls smp_send_stop() to send IPIs to non-boot cpus, then non-boot
cpus call stop_this_cpu(). This is why stop_this_cpu() needs
rcutree_report_cpu_dead().
Huacai
>
> > Sebastian
>
> Best,
> Jonas
>