srcu: Prevent __call_srcu() counter wrap with read-side critical section
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 25 Apr 2018 20:01:25 +0000 (13:01 -0700)
committerPaul E. McKenney <paulmck@linux.ibm.com>
Fri, 9 Nov 2018 05:54:14 +0000 (21:54 -0800)
commit0607ba8403c4cdb253f8c5200ecf654dfb7790cc
tree1c980c7df600c90717f87172df7d9259a233a87a
parentf3e763c3e544b73ae5c4a3842cedb9ff6ca37715
srcu: Prevent __call_srcu() counter wrap with read-side critical section

Ever since cdf7abc4610a ("srcu: Allow use of Tiny/Tree SRCU from
both process and interrupt context"), it has been permissible
to use SRCU read-side critical sections in interrupt context.
This allows __call_srcu() to use SRCU read-side critical sections to
prevent a new SRCU grace period from ending before the call to either
srcu_funnel_gp_start() or srcu_funnel_exp_start completes, thus preventing
SRCU grace-period counter overflow during that time.

Note that this does not permit removal of the counter-wrap checks in
srcu_gp_end().  These check are necessary to handle the case where
a given CPU does not interact at all with SRCU for an extended time
period.

This commit therefore adds an SRCU read-side critical section to
__call_srcu() in order to prevent grace period counter wrap during
the funnel-locking process.

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