* [PATCH] riscv: Report dying CPU to RCU in IPI_CPU_STOP
@ 2026-06-22 13:40 ` Guo Ren
0 siblings, 0 replies; 2+ messages in thread
From: Guo Ren @ 2026-06-22 13:40 UTC (permalink / raw)
To: pjw, palmer, aou, alex, samuel.holland, tglx, bigeasy
Cc: linux-riscv, linux-kernel, Guo Ren (Alibaba DAMO Academy), stable,
Huacai Chen, Jonas Jelonek, Thomas Bogendoerfer, Steven Rostedt,
Jiayuan Chen
From: "Guo Ren (Alibaba DAMO Academy)" <guoren@kernel.org>
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: stable@vger.kernel.org
Cc: Huacai Chen <chenhuacai@loongson.cn>
Cc: Jonas Jelonek <jelonek.jonas@gmail.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Jiayuan Chen <jiayuan.chen@linux.dev>
Cc: Thomas Gleixner <tglx@kernel.org>
Fixes: 91840be8f710 ("irq_work: Fix use-after-free in irq_work_single() on PREEMPT_RT")
Signed-off-by: Guo Ren (Alibaba DAMO Academy) <guoren@kernel.org>
---
arch/riscv/kernel/smp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c
index fa66f9c97d74..0a73b36be825 100644
--- a/arch/riscv/kernel/smp.c
+++ b/arch/riscv/kernel/smp.c
@@ -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();
}
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] riscv: Report dying CPU to RCU in IPI_CPU_STOP
@ 2026-06-22 13:40 ` Guo Ren
0 siblings, 0 replies; 2+ messages in thread
From: Guo Ren @ 2026-06-22 13:40 UTC (permalink / raw)
To: pjw, palmer, aou, alex, samuel.holland, tglx, bigeasy
Cc: linux-riscv, linux-kernel, Guo Ren (Alibaba DAMO Academy), stable,
Huacai Chen, Jonas Jelonek, Thomas Bogendoerfer, Steven Rostedt,
Jiayuan Chen
From: "Guo Ren (Alibaba DAMO Academy)" <guoren@kernel.org>
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: stable@vger.kernel.org
Cc: Huacai Chen <chenhuacai@loongson.cn>
Cc: Jonas Jelonek <jelonek.jonas@gmail.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Jiayuan Chen <jiayuan.chen@linux.dev>
Cc: Thomas Gleixner <tglx@kernel.org>
Fixes: 91840be8f710 ("irq_work: Fix use-after-free in irq_work_single() on PREEMPT_RT")
Signed-off-by: Guo Ren (Alibaba DAMO Academy) <guoren@kernel.org>
---
arch/riscv/kernel/smp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c
index fa66f9c97d74..0a73b36be825 100644
--- a/arch/riscv/kernel/smp.c
+++ b/arch/riscv/kernel/smp.c
@@ -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();
}
--
2.43.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-22 13:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-22 13:40 [PATCH] riscv: Report dying CPU to RCU in IPI_CPU_STOP Guo Ren
2026-06-22 13:40 ` Guo Ren
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.