riscv: Report dying CPU to RCU in IPI_CPU_STOP
Subsystems (2)
PATCH 1/1 riscv: Report dying CPU to RCU in IPI_CPU_STOP
From: "Guo Ren (Alibaba DAMO Academy)" <[email protected]>
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.
Cc Huacai Chen <[email protected]>
Cc Jonas Jelonek <[email protected]>
Cc Thomas Bogendoerfer <[email protected]>
Cc Sebastian Andrzej Siewior <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc Jiayuan Chen <[email protected]>
Cc Thomas Gleixner <[email protected]>
Fixes 91840be8f710 ("irq_work: Fix use-after-free in irq_work_single() on PREEMPT_RT")
Signed-off-by Guo Ren (Alibaba DAMO Academy) <[email protected]>
--- arch/riscv/kernel/smp.c | 1 + 1 file changed, 1 insertion(+)
arch/riscv/kernel/smp.c +1 -0
@@ -82,6 +82,7 @@ int riscv_hartid_to_cpuid(unsigned long hartid)static void ipi_stop (void ) {set_cpu_online (smp_processor_id (), false); +rcutree_report_cpu_dead ();while (1 )wait_for_interrupt (); }
Signature · 1 line
2.43.0