]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
rcu: Don't use negative nesting depth in __rcu_read_unlock()
authorLai Jiangshan <laijs@linux.alibaba.com>
Sat, 15 Feb 2020 23:23:26 +0000 (15:23 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 27 Apr 2020 18:03:50 +0000 (11:03 -0700)
commit5f5fa7ea89dc82d34ed458f4d7a8634e8e9eefce
tree8c19516e97d1332d9a57d3fe65c3e84a70183208
parentf0bdf6d473cf12a488a78422e15aafdfe77cf853
rcu: Don't use negative nesting depth in __rcu_read_unlock()

Now that RCU flavors have been consolidated, an RCU-preempt
rcu_read_unlock() in an interrupt or softirq handler cannot possibly
end the RCU read-side critical section.  Consider the old vulnerability
involving rcu_read_unlock() being invoked within such a handler that
interrupted an __rcu_read_unlock_special(), in which a wakeup might be
invoked with a scheduler lock held.  Because rcu_read_unlock_special()
no longer does wakeups in such situations, it is no longer necessary
for __rcu_read_unlock() to set the nesting level negative.

This commit therefore removes this recursion-protection code from
__rcu_read_unlock().

[ paulmck: Let rcu_exp_handler() continue to call rcu_report_exp_rdp(). ]
[ paulmck: Adjust other checks given no more negative nesting. ]
Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree_exp.h
kernel/rcu/tree_plugin.h