Skip to content

Commit 9ced454

Browse files
irengepaulmckrcu
authored andcommitted
rcu: Add missing annotation for rcu_nocb_bypass_lock()
Sparse reports warning at rcu_nocb_bypass_lock() |warning: context imbalance in rcu_nocb_bypass_lock() - wrong count at exit To fix this, this commit adds an __acquires(&rdp->nocb_bypass_lock). Given that rcu_nocb_bypass_lock() does actually call raw_spin_lock() when raw_spin_trylock() fails, this not only fixes the warning but also improves on the readability of the code. Signed-off-by: Jules Irenge <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 5648d65 commit 9ced454

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/rcu/tree_plugin.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,6 +1486,7 @@ module_param(nocb_nobypass_lim_per_jiffy, int, 0);
14861486
* flag the contention.
14871487
*/
14881488
static void rcu_nocb_bypass_lock(struct rcu_data *rdp)
1489+
__acquires(&rdp->nocb_bypass_lock)
14891490
{
14901491
lockdep_assert_irqs_disabled();
14911492
if (raw_spin_trylock(&rdp->nocb_bypass_lock))

0 commit comments

Comments
 (0)