From: "Paul E. McKenney" <paulmck@us.ibm.com>
To: Josh Triplett <josht@vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org,
Dipkanar Sarma <dipankar@in.ibm.com>,
Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] rcu: Add lock annotations to RCU locking primitives
Date: Thu, 29 Jun 2006 14:49:48 -0700 [thread overview]
Message-ID: <20060629214948.GJ1294@us.ibm.com> (raw)
In-Reply-To: <1151617163.6507.15.camel@josh-work.beaverton.ibm.com>
On Thu, Jun 29, 2006 at 02:39:23PM -0700, Josh Triplett wrote:
> Add __acquire annotations to rcu_read_lock and rcu_read_lock_bh, and add
> __release annotations to rcu_read_unlock and rcu_read_unlock_bh. This allows
> sparse to detect improperly paired calls to these functions.
I will take whatever automated help I can get!!!
Acked-by: Paul E. McKenney <paulmck@us.ibm.com>
> Signed-off-by: Josh Triplett <josh@freedesktop.org>
>
> ---
>
> include/linux/rcupdate.h | 24 ++++++++++++++++++++----
> 1 files changed, 20 insertions(+), 4 deletions(-)
>
> 0a6ff66d5cf24cf6106c933e1f183687358ebc7e
> diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
> index 48dfe00..b4ca73d 100644
> --- a/include/linux/rcupdate.h
> +++ b/include/linux/rcupdate.h
> @@ -163,14 +163,22 @@ extern int rcu_needs_cpu(int cpu);
> *
> * It is illegal to block while in an RCU read-side critical section.
> */
> -#define rcu_read_lock() preempt_disable()
> +#define rcu_read_lock() \
> + do { \
> + preempt_disable(); \
> + __acquire(RCU); \
> + } while(0)
>
> /**
> * rcu_read_unlock - marks the end of an RCU read-side critical section.
> *
> * See rcu_read_lock() for more information.
> */
> -#define rcu_read_unlock() preempt_enable()
> +#define rcu_read_unlock() \
> + do { \
> + __release(RCU); \
> + preempt_enable(); \
> + } while(0)
>
> /*
> * So where is rcu_write_lock()? It does not exist, as there is no
> @@ -193,14 +201,22 @@ #define rcu_read_unlock() preempt_enable
> * can use just rcu_read_lock().
> *
> */
> -#define rcu_read_lock_bh() local_bh_disable()
> +#define rcu_read_lock_bh() \
> + do { \
> + local_bh_disable(); \
> + __acquire(RCU_BH); \
> + } while(0)
>
> /*
> * rcu_read_unlock_bh - marks the end of a softirq-only RCU critical section
> *
> * See rcu_read_lock_bh() for more information.
> */
> -#define rcu_read_unlock_bh() local_bh_enable()
> +#define rcu_read_unlock_bh() \
> + do { \
> + __release(RCU_BH); \
> + local_bh_enable(); \
> + } while(0)
>
> /**
> * rcu_dereference - fetch an RCU-protected pointer in an
>
>
prev parent reply other threads:[~2006-06-29 21:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-29 21:39 Josh Triplett
2006-06-29 21:49 ` Paul E. McKenney [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060629214948.GJ1294@us.ibm.com \
--to=paulmck@us.ibm.com \
--cc=akpm@osdl.org \
--cc=dipankar@in.ibm.com \
--cc=josht@vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome