]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rcu/exp: Remove superfluous full memory barrier upon first EQS snapshot
authorFrederic Weisbecker <frederic@kernel.org>
Thu, 27 Jun 2024 11:36:58 +0000 (13:36 +0200)
committerPaul E. McKenney <paulmck@kernel.org>
Fri, 28 Jun 2024 13:43:34 +0000 (06:43 -0700)
commit33c0860bf7e7ace39eba96f51cc6d898ab253202
treef43a3eb71055733262b4e90723cb18ed2c4c3565
parent9a7e73c9bedfecd00370403b5d35514b2d3aba3d
rcu/exp: Remove superfluous full memory barrier upon first EQS snapshot

When the grace period kthread checks the extended quiescent state
counter of a CPU, full ordering is necessary to ensure that either:

* If the GP kthread observes the remote target in an extended quiescent
  state, then that target must observe all accesses prior to the current
  grace period, including the current grace period sequence number, once
  it exits that extended quiescent state.

or:

* If the GP kthread observes the remote target NOT in an extended
  quiescent state, then the target further entering in an extended
  quiescent state must observe all accesses prior to the current
  grace period, including the current grace period sequence number, once
  it enters that extended quiescent state.

This ordering is enforced through a full memory barrier placed right
before taking the first EQS snapshot. However this is superfluous
because the snapshot is taken while holding the target's rnp lock which
provides the necessary ordering through its chain of
smp_mb__after_unlock_lock().

Remove the needless explicit barrier before the snapshot and put a
comment about the implicit barrier newly relied upon here.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Neeraj Upadhyay <neeraj.upadhyay@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree_exp.h