OSDN Git Service

rcu: Report QS for outermost PREEMPT=n rcu_read_unlock() for strict GPs
authorPaul E. McKenney <paulmck@kernel.org>
Mon, 10 Aug 2020 16:58:03 +0000 (09:58 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 25 Aug 2020 01:40:28 +0000 (18:40 -0700)
commitaa40c138cc8f36e2f5c721fd1bdb823a1ef1a237
tree1d11865aac5e5ebcc63068a9d636c3a451d43424
parenta657f2617010ae237db5693f875968c28e8f732f
rcu: Report QS for outermost PREEMPT=n rcu_read_unlock() for strict GPs

The CONFIG_PREEMPT=n instance of rcu_read_unlock is even more
aggressively than that of CONFIG_PREEMPT=y in deferring reporting
quiescent states to the RCU core.  This is just what is wanted in normal
use because it reduces overhead, but the resulting delay is not what
is wanted for kernels built with CONFIG_RCU_STRICT_GRACE_PERIOD=y.
This commit therefore adds an rcu_read_unlock_strict() function that
checks for exceptional conditions, and reports the newly started
quiescent state if it is safe to do so, also doing a spin-delay if
requested via rcutree.rcu_unlock_delay.  This commit also adds a call
to rcu_read_unlock_strict() from the CONFIG_PREEMPT=n instance of
__rcu_read_unlock().

[ paulmck: Fixed bug located by kernel test robot <lkp@intel.com> ]
Reported-by Jann Horn <jannh@google.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
include/linux/rcupdate.h
kernel/rcu/tree.c
kernel/rcu/tree_plugin.h