[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20200120224215.51740-1-jbi.octave@gmail.com>
Date: Mon, 20 Jan 2020 22:42:15 +0000
From: Jules Irenge <jbi.octave@...il.com>
To: paulmck@...nel.org
Cc: rostedt@...dmis.org, mathieu.desnoyers@...icios.com,
joel@...lfernandes.org, rcu@...r.kernel.org, iangshanlai@...il.com,
boqun.feng@...il.com, linux-kernel@...r.kernel.org,
Jules Irenge <jbi.octave@...il.com>
Subject: [PATCH 4/5] 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, an __acquires(&rdp->nocb_bypass_lock) is added.
Given that rcu_nocb_bypass_lock() does actually
call raw_spin_lock(&rdp->nocb_bypass_lock)
in case raw_spin_trylock(&rdp->nocb_bypass_lock) fails.
This not only fixes the warning
but also improves on the readability of the code.
Signed-off-by: Jules Irenge <jbi.octave@...il.com>
---
kernel/rcu/tree_plugin.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index fa08d55f7040..7689e649b674 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -1510,6 +1510,7 @@ module_param(nocb_nobypass_lim_per_jiffy, int, 0);
* flag the contention.
*/
static void rcu_nocb_bypass_lock(struct rcu_data *rdp)
+ __acquires(&rdp->nocb_bypass_lock)
{
lockdep_assert_irqs_disabled();
if (raw_spin_trylock(&rdp->nocb_bypass_lock))
--
2.24.1
Powered by blists - more mailing lists