]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
srcu: Provide polling interfaces for Tree SRCU grace periods
authorPaul E. McKenney <paulmck@kernel.org>
Sat, 14 Nov 2020 01:31:55 +0000 (17:31 -0800)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 24 Sep 2021 09:58:50 +0000 (11:58 +0200)
commitff1c9ca494420b2c1967fea2521de54ec63b7676
tree4eabbcdd35f7625d8cb7abd946f38384b4f07937
parentadb11085ec8d9e81d176bc5d18a4fab9fe3c2222
srcu: Provide polling interfaces for Tree SRCU grace periods

BugLink: https://bugs.launchpad.net/bugs/1944610
commit 5358c9fa54b09b5d3d7811b033aa0838c1bbaaf2 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
kernel/rcu/srcutree.c