]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rcu: Make rcu_barrier() account for offline no-CBs CPUs
authorPaul E. McKenney <paulmck@kernel.org>
Tue, 11 Feb 2020 14:17:33 +0000 (06:17 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Apr 2020 14:12:03 +0000 (16:12 +0200)
commit395d7759806ce7502441b77b0dda45a14ef1a004
tree2ee540fd0fb992c9f8e6d074ec1d3c758f96b39c
parent568b775a5dad85f3e6c339841b7919d42a85954f
rcu: Make rcu_barrier() account for offline no-CBs CPUs

commit 127e29815b4b2206c0a97ac1d83f92ffc0e25c34 upstream.

Currently, rcu_barrier() ignores offline CPUs,  However, it is possible
for an offline no-CBs CPU to have callbacks queued, and rcu_barrier()
must wait for those callbacks.  This commit therefore makes rcu_barrier()
directly invoke the rcu_barrier_func() with interrupts disabled for such
CPUs.  This requires passing the CPU number into this function so that
it can entrain the rcu_barrier() callback onto the correct CPU's callback
list, given that the code must instead execute on the current CPU.

While in the area, this commit fixes a bug where the first CPU's callback
might have been invoked before rcu_segcblist_entrain() returned, which
would also result in an early wakeup.

Fixes: 5d6742b37727 ("rcu/nocb: Use rcu_segcblist for no-CBs CPUs")
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
[ paulmck: Apply optimization feedback from Boqun Feng. ]
Cc: <stable@vger.kernel.org> # 5.5.x
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/trace/events/rcu.h
kernel/rcu/tree.c