]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
srcu: Make Tiny SRCU use multi-bit grace-period counter
authorPaul E. McKenney <paulmck@kernel.org>
Fri, 13 Nov 2020 00:34:09 +0000 (16:34 -0800)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 24 Sep 2021 09:58:50 +0000 (11:58 +0200)
commitde1df739278e11aa8c82a4c7924e8b5221f2580f
tree2721ec468630adb0fb30e30127431fdfccbee1ed
parentc156b9ae3e269e3c51cda481d4edd23c3505ba4a
srcu: Make Tiny SRCU use multi-bit grace-period counter

BugLink: https://bugs.launchpad.net/bugs/1944610
commit 74612a07b83fc46c2b2e6f71a541d55b024ebefc upstream.

There is a need for a polling interface for SRCU grace periods.  This
polling needs to distinguish between an SRCU instance being idle on the
one hand or in the middle of a grace period on the other.  This commit
therefore converts the Tiny SRCU srcu_struct structure's srcu_idx from
a defacto boolean to a free-running counter, using the bottom bit to
indicate that a grace period is in progress.  The second-from-bottom
bit is thus used as the index returned by srcu_read_lock().

Link: https://lore.kernel.org/rcu/20201112201547.GF3365678@moria.home.lan/
Reported-by: Kent Overstreet <kent.overstreet@gmail.com>
[ paulmck: Fix ->srcu_lock_nesting[] indexing per Neeraj Upadhyay. ]
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>
include/linux/srcutiny.h
kernel/rcu/srcutiny.c