Skip to content

Commit 04e613d

Browse files
committed
arm64: smp: Tell RCU about CPUs that fail to come online
Commit ce3d31a ("arm64/smp: Move rcu_cpu_starting() earlier") ensured that RCU is informed early about incoming CPUs that might end up calling into printk() before they are online. However, if such a CPU fails the early CPU feature compatibility checks in check_local_cpu_capabilities(), then it will be powered off or parked without informing RCU, leading to an endless stream of stalls: | rcu: INFO: rcu_preempt detected stalls on CPUs/tasks: | rcu: 2-O...: (0 ticks this GP) idle=002/1/0x4000000000000000 softirq=0/0 fqs=2593 | (detected by 0, t=5252 jiffies, g=9317, q=136) | Task dump for CPU 2: | task:swapper/2 state:R running task stack: 0 pid: 0 ppid: 1 flags:0x00000028 | Call trace: | ret_from_fork+0x0/0x30 Ensure that the dying CPU invokes rcu_report_dead() prior to being powered off or parked. Cc: Qian Cai <cai@redhat.com> Cc: "Paul E. McKenney" <paulmck@kernel.org> Reviewed-by: Paul E. McKenney <paulmck@kernel.org> Suggested-by: Qian Cai <cai@redhat.com> Link: https://lore.kernel.org/r/20201105222242.GA8842@willie-the-truck Link: https://lore.kernel.org/r/20201106103602.9849-3-will@kernel.org Signed-off-by: Will Deacon <will@kernel.org>
1 parent 891deb8 commit 04e613d

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

arch/arm64/kernel/smp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ void cpu_die_early(void)
413413

414414
/* Mark this CPU absent */
415415
set_cpu_present(cpu, 0);
416+
rcu_report_dead(cpu);
416417

417418
if (IS_ENABLED(CONFIG_HOTPLUG_CPU)) {
418419
update_cpu_boot_status(CPU_KILL_ME);

kernel/rcu/tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4077,7 +4077,6 @@ void rcu_cpu_starting(unsigned int cpu)
40774077
smp_mb(); /* Ensure RCU read-side usage follows above initialization. */
40784078
}
40794079

4080-
#ifdef CONFIG_HOTPLUG_CPU
40814080
/*
40824081
* The outgoing function has no further need of RCU, so remove it from
40834082
* the rcu_node tree's ->qsmaskinitnext bit masks.
@@ -4117,6 +4116,7 @@ void rcu_report_dead(unsigned int cpu)
41174116
rdp->cpu_started = false;
41184117
}
41194118

4119+
#ifdef CONFIG_HOTPLUG_CPU
41204120
/*
41214121
* The outgoing CPU has just passed through the dying-idle state, and we
41224122
* are being invoked from the CPU that was IPIed to continue the offline

0 commit comments

Comments
 (0)