Skip to content

Commit c90b9e4

Browse files
paulmckrcuurezki
authored andcommitted
rcu: Bring diagnostic read of rcu_state.gp_flags into alignment
This commit adds READ_ONCE() to a lockless diagnostic read from rcu_state.gp_flags to avoid giving the compiler any chance whatsoever of confusing the diagnostic state printed. Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
1 parent 62bb24c commit c90b9e4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/rcu/tree_stall.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ static void rcu_check_gp_kthread_expired_fqs_timer(void)
579579
pr_err("%s kthread timer wakeup didn't happen for %ld jiffies! g%ld f%#x %s(%d) ->state=%#x\n",
580580
rcu_state.name, (jiffies - jiffies_fqs),
581581
(long)rcu_seq_current(&rcu_state.gp_seq),
582-
data_race(rcu_state.gp_flags),
582+
data_race(READ_ONCE(rcu_state.gp_flags)), // Diagnostic read
583583
gp_state_getname(RCU_GP_WAIT_FQS), RCU_GP_WAIT_FQS,
584584
data_race(READ_ONCE(gpk->__state)));
585585
pr_err("\tPossible timer handling issue on cpu=%d timer-softirq=%u\n",

0 commit comments

Comments
 (0)