srcu: Provide polling interfaces for Tiny SRCU grace periods
authorPaul E. McKenney <paulmck@kernel.org>
Fri, 13 Nov 2020 20:54:48 +0000 (12:54 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 4 Jan 2021 21:53:38 +0000 (13:53 -0800)
commit8b5bd67cf6422b63ee100d76d8de8960ca2df7f0
tree9bc4242c2aa4cfaad727526339abf4ede5d15eb0
parent29d2bb94a8a126ce80ffbb433b648b32fdea524e
srcu: Provide polling interfaces for Tiny SRCU grace periods

There is a need for a polling interface for SRCU grace
periods, so this commit supplies get_state_synchronize_srcu(),
start_poll_synchronize_srcu(), and poll_state_synchronize_srcu() for this
purpose.  The first can be used if future grace periods are inevitable
(perhaps due to a later call_srcu() invocation), the second if future
grace periods might not otherwise happen, and the third to check if a
grace period has elapsed since the corresponding call to either of the
first two.

As with get_state_synchronize_rcu() and cond_synchronize_rcu(),
the return value from either get_state_synchronize_srcu() or
start_poll_synchronize_srcu() must be passed in to a later call to
poll_state_synchronize_srcu().

Link: https://lore.kernel.org/rcu/20201112201547.GF3365678@moria.home.lan/
Reported-by: Kent Overstreet <kent.overstreet@gmail.com>
[ paulmck: Add EXPORT_SYMBOL_GPL() per kernel test robot feedback. ]
[ paulmck: Apply feedback from Neeraj Upadhyay. ]
Link: https://lore.kernel.org/lkml/20201117004017.GA7444@paulmck-ThinkPad-P72/
Reviewed-by: Neeraj Upadhyay <neeraju@codeaurora.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
include/linux/rcupdate.h
include/linux/srcu.h
include/linux/srcutiny.h
kernel/rcu/srcutiny.c