When a CPU dies and reports QS via rcutree_report_cpu_dead(), any tasks blocked on that CPU's per-CPU blocked list must first be promoted to the rcu_node's blkd_tasks list.
Without this promotion, blocked tasks on the dying CPU's per-CPU list won't have gp_tasks point to them, so the GP machinery won't wait for them. This can cause "Wrong-GP reads" errors where a GP completes while readers are still in their critical sections. Therefore, call rcu_promote_blocked_tasks_rdp() before reporting QS. Signed-off-by: Joel Fernandes <[email protected]> --- kernel/rcu/tree.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 19fd13c1e6be..5e73ebb260e3 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -4460,6 +4460,11 @@ void rcutree_report_cpu_dead(void) rdp->rcu_ofl_gp_seq = READ_ONCE(rcu_state.gp_seq); rdp->rcu_ofl_gp_state = READ_ONCE(rcu_state.gp_state); if (rnp->qsmask & mask) { /* RCU waiting on outgoing CPU? */ + /* + * Promote blocked tasks from dying CPU's per-CPU list before + * reporting QS. Otherwise those tasks won't block the GP. + */ + rcu_promote_blocked_tasks_rdp(rdp, rnp); /* Report quiescent state -before- changing ->qsmaskinitnext! */ rcu_disable_urgency_upon_qs(rdp); rcu_report_qs_rnp(mask, rnp, rnp->gp_seq, flags); -- 2.34.1

