OSDN Git Service

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)
committerPaul E. McKenney <paulmck@kernel.org>
Sat, 21 Mar 2020 23:14:25 +0000 (16:14 -0700)
commit127e29815b4b2206c0a97ac1d83f92ffc0e25c34
treecca6e76ccf57d6701a14a6fccefe6a1e5b890cd9
parent0f11ad323dd3d316830152de63b5737a6261ad14
rcu: Make rcu_barrier() account for offline no-CBs CPUs

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
include/trace/events/rcu.h
kernel/rcu/tree.c