rcu/nocb: Make IRQs disablement symmetric
authorFrederic Weisbecker <frederic@kernel.org>
Tue, 9 Jan 2024 22:24:00 +0000 (23:24 +0100)
committerBoqun Feng <boqun.feng@gmail.com>
Wed, 14 Feb 2024 15:50:45 +0000 (07:50 -0800)
commitb913c3fe685e0aec80130975b0f330fd709ff324
treebd4a095d20b45080668a333098241559b71f1def
parent1e8e6951a5774c8dd9d1f14af9c5b7d66130d96f
rcu/nocb: Make IRQs disablement symmetric

Currently IRQs are disabled on call_rcu() and then depending on the
context:

* If the CPU is in nocb mode:

   - If the callback is enqueued in the bypass list, IRQs are re-enabled
     implictly by rcu_nocb_try_bypass()

   - If the callback is enqueued in the normal list, IRQs are re-enabled
     implicitly by __call_rcu_nocb_wake()

* If the CPU is NOT in nocb mode, IRQs are reenabled explicitly from call_rcu()

This makes the code a bit hard to follow, especially as it interleaves
with nocb locking.

To make the IRQ flags coverage clearer and also in order to prepare for
moving all the nocb enqueue code to its own function, always re-enable
the IRQ flags explicitly from call_rcu().

Reviewed-by: Neeraj Upadhyay (AMD) <neeraj.iitr10@gmail.com>
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_nocb.h