rcu: Mark sync_sched_exp_online_cleanup() ->cpu_no_qs.b.exp load
authorPaul E. McKenney <paulmck@kernel.org>
Tue, 28 Sep 2021 18:06:35 +0000 (11:06 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Wed, 8 Dec 2021 00:22:21 +0000 (16:22 -0800)
The sync_sched_exp_online_cleanup() is called from rcutree_online_cpu(),
which can be invoked with interrupts enabled.  This means that
the ->cpu_no_qs.b.exp field is subject to data races from the
rcu_exp_handler() IPI handler, so this commit marks the load from
that field.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree_exp.h

index fc2ee326a6f73b0d2b5f6af808fba1a6475b1c8f..12f1a18d7b6d620ba940f7791ffd61b0cb93deee 100644 (file)
@@ -759,7 +759,7 @@ static void sync_sched_exp_online_cleanup(int cpu)
        my_cpu = get_cpu();
        /* Quiescent state either not needed or already requested, leave. */
        if (!(READ_ONCE(rnp->expmask) & rdp->grpmask) ||
-           rdp->cpu_no_qs.b.exp) {
+           READ_ONCE(rdp->cpu_no_qs.b.exp)) {
                put_cpu();
                return;
        }