Message ID | 20230717180317.1097590-4-paulmck@kernel.org (mailing list archive) |
---|---|
State | Accepted |
Commit | 5bafd087a256b259ddcd9b905005a346c04c2cd8 |
Headers | show |
Series | Miscellaneous fixes for v6.6 | expand |
On 7/17/23 14:03, Paul E. McKenney wrote: > The rcu_request_urgent_qs_task() function does a cross-CPU store > to ->rcu_urgent_qs, so this commit therefore marks the load in > __rcu_irq_enter_check_tick() with READ_ONCE(). > > Signed-off-by: Paul E. McKenney <paulmck@kernel.org> > --- > kernel/rcu/tree.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > index fae9b4e29c93..aec07f2ec638 100644 > --- a/kernel/rcu/tree.c > +++ b/kernel/rcu/tree.c > @@ -632,7 +632,7 @@ void __rcu_irq_enter_check_tick(void) > // prevents self-deadlock. So we can safely recheck under the lock. > // Note that the nohz_full state currently cannot change. > raw_spin_lock_rcu_node(rdp->mynode); > - if (rdp->rcu_urgent_qs && !rdp->rcu_forced_tick) { > + if (READ_ONCE(rdp->rcu_urgent_qs) && !rdp->rcu_forced_tick) { > // A nohz_full CPU is in the kernel and RCU needs a > // quiescent state. Turn on the tick! > WRITE_ONCE(rdp->rcu_forced_tick, Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org> thanks, - Joel
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index fae9b4e29c93..aec07f2ec638 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -632,7 +632,7 @@ void __rcu_irq_enter_check_tick(void) // prevents self-deadlock. So we can safely recheck under the lock. // Note that the nohz_full state currently cannot change. raw_spin_lock_rcu_node(rdp->mynode); - if (rdp->rcu_urgent_qs && !rdp->rcu_forced_tick) { + if (READ_ONCE(rdp->rcu_urgent_qs) && !rdp->rcu_forced_tick) { // A nohz_full CPU is in the kernel and RCU needs a // quiescent state. Turn on the tick! WRITE_ONCE(rdp->rcu_forced_tick, true);
The rcu_request_urgent_qs_task() function does a cross-CPU store to ->rcu_urgent_qs, so this commit therefore marks the load in __rcu_irq_enter_check_tick() with READ_ONCE(). Signed-off-by: Paul E. McKenney <paulmck@kernel.org> --- kernel/rcu/tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)