rcu: Convert conditional grace-period primitives to ->gp_seq
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Fri, 27 Apr 2018 22:16:50 +0000 (15:16 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Thu, 12 Jul 2018 21:27:49 +0000 (14:27 -0700)
commite4be81a2ed3a7356a2c22c7571af622ceb57eb2b
tree38cbee1c366f001f058b327acc7fda176e08d793
parentc9a24e2d0c7d33b141167f5fa13f95cf6d35cb1e
rcu: Convert conditional grace-period primitives to ->gp_seq

This commit converts get_state_synchronize_rcu(), cond_synchronize_rcu(),
get_state_synchronize_sched(), and cond_synchronize_sched() from ->gpnum
and ->completed to ->gp_seq.  Note that this also introduces a full
memory barrier in the already-done paths off cond_synchronize_rcu() and
cond_synchronize_sched(), as work with LKMM indicates that the earlier
smp_load_acquire() were insufficiently strong in some situations where
these two functions were called just as the grace period ended.  In such
cases, these two functions would not gain the benefit of memory ordering
at the end of the grace period.

Please note that the performance impact is negligible, as you shouldn't
be using either function anywhere near a fastpath in any case.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcu/tree.c