rcu/nocb: Re-arrange call_rcu() NOCB specific code
authorFrederic Weisbecker <frederic@kernel.org>
Tue, 9 Jan 2024 22:24:01 +0000 (23:24 +0100)
committerBoqun Feng <boqun.feng@gmail.com>
Wed, 14 Feb 2024 15:50:45 +0000 (07:50 -0800)
commitafd4e6964745ed98b74cacdcce21d73280a0a253
tree1c4ed9bee5011509092b603595c8b7724f393751
parentb913c3fe685e0aec80130975b0f330fd709ff324
rcu/nocb: Re-arrange call_rcu() NOCB specific code

Currently the call_rcu() function interleaves NOCB and !NOCB enqueue
code in a complicated way such that:

* The bypass enqueue code may or may not have enqueued and may or may
  not have locked the ->nocb_lock. Everything that follows is in a
  Schrödinger locking state for the unwary reviewer's eyes.

* The was_alldone is always set but only used in NOCB related code.

* The NOCB wake up is distantly related to the locking hopefully
  performed by the bypass enqueue code that did not enqueue on the
  bypass list.

Unconfuse the whole and gather NOCB and !NOCB specific enqueue code to
their own functions.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
kernel/rcu/tree.c
kernel/rcu/tree.h
kernel/rcu/tree_nocb.h