]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rcu: Bring diagnostic read of rcu_state.gp_flags into alignment
authorPaul E. McKenney <paulmck@kernel.org>
Thu, 7 Mar 2024 23:06:19 +0000 (15:06 -0800)
committerUladzislau Rezki (Sony) <urezki@gmail.com>
Mon, 15 Apr 2024 14:28:44 +0000 (16:28 +0200)
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>
kernel/rcu/tree_stall.h

index 5d666428546b03ac9e865fbc6e1ae9b1e057100f..62b2c4858028553a5fcd73c596ef5be3fd21d03e 100644 (file)
@@ -579,7 +579,7 @@ static void rcu_check_gp_kthread_expired_fqs_timer(void)
                pr_err("%s kthread timer wakeup didn't happen for %ld jiffies! g%ld f%#x %s(%d) ->state=%#x\n",
                       rcu_state.name, (jiffies - jiffies_fqs),
                       (long)rcu_seq_current(&rcu_state.gp_seq),
-                      data_race(rcu_state.gp_flags),
+                      data_race(READ_ONCE(rcu_state.gp_flags)), // Diagnostic read
                       gp_state_getname(RCU_GP_WAIT_FQS), RCU_GP_WAIT_FQS,
                       data_race(READ_ONCE(gpk->__state)));
                pr_err("\tPossible timer handling issue on cpu=%d timer-softirq=%u\n",