public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "tip-bot for Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, paulmck@linux.vnet.ibm.com,
	hpa@zytor.com, mingo@redhat.com, tglx@linutronix.de,
	mingo@elte.hu
Subject: [tip:core/rcu] rcu: Consolidate sparse and lockdep declarations in include/linux/rcupdate.h
Date: Sun, 23 Aug 2009 09:02:06 GMT	[thread overview]
Message-ID: <tip-bc33f24bdca8b6e97376e3a182ab69e6cdefa989@git.kernel.org> (raw)
In-Reply-To: <12509746132349-git-send-email->

Commit-ID:  bc33f24bdca8b6e97376e3a182ab69e6cdefa989
Gitweb:     http://git.kernel.org/tip/bc33f24bdca8b6e97376e3a182ab69e6cdefa989
Author:     Paul E. McKenney <paulmck@linux.vnet.ibm.com>
AuthorDate: Sat, 22 Aug 2009 13:56:47 -0700
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Sun, 23 Aug 2009 10:32:37 +0200

rcu: Consolidate sparse and lockdep declarations in include/linux/rcupdate.h

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: laijs@cn.fujitsu.com
Cc: dipankar@in.ibm.com
Cc: akpm@linux-foundation.org
Cc: mathieu.desnoyers@polymtl.ca
Cc: josht@linux.vnet.ibm.com
Cc: dvhltc@us.ibm.com
Cc: niv@us.ibm.com
Cc: peterz@infradead.org
Cc: rostedt@goodmis.org
LKML-Reference: <12509746132349-git-send-email->
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 include/linux/rcupdate.h   |   46 ++++++++++++++++++++++++++++++++++++++++---
 include/linux/rcupreempt.h |    4 +-
 include/linux/rcutree.h    |   18 -----------------
 3 files changed, 44 insertions(+), 24 deletions(-)

diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index e920f0f..9d85ee1 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -80,6 +80,16 @@ extern int rcu_scheduler_active;
        (ptr)->next = NULL; (ptr)->func = NULL; \
 } while (0)
 
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+extern struct lockdep_map rcu_lock_map;
+# define rcu_read_acquire()	\
+			lock_acquire(&rcu_lock_map, 0, 0, 2, 1, NULL, _THIS_IP_)
+# define rcu_read_release()	lock_release(&rcu_lock_map, 1, _THIS_IP_)
+#else
+# define rcu_read_acquire()	do { } while (0)
+# define rcu_read_release()	do { } while (0)
+#endif
+
 /**
  * rcu_read_lock - mark the beginning of an RCU read-side critical section.
  *
@@ -109,7 +119,12 @@ extern int rcu_scheduler_active;
  *
  * It is illegal to block while in an RCU read-side critical section.
  */
-#define rcu_read_lock() __rcu_read_lock()
+static inline void rcu_read_lock(void)
+{
+	__rcu_read_lock();
+	__acquire(RCU);
+	rcu_read_acquire();
+}
 
 /**
  * rcu_read_unlock - marks the end of an RCU read-side critical section.
@@ -126,7 +141,12 @@ extern int rcu_scheduler_active;
  * used as well.  RCU does not care how the writers keep out of each
  * others' way, as long as they do so.
  */
-#define rcu_read_unlock() __rcu_read_unlock()
+static inline void rcu_read_unlock(void)
+{
+	rcu_read_release();
+	__release(RCU);
+	__rcu_read_unlock();
+}
 
 /**
  * rcu_read_lock_bh - mark the beginning of a softirq-only RCU critical section
@@ -139,14 +159,24 @@ extern int rcu_scheduler_active;
  * can use just rcu_read_lock().
  *
  */
-#define rcu_read_lock_bh() __rcu_read_lock_bh()
+static inline void rcu_read_lock_bh(void)
+{
+	__rcu_read_lock_bh();
+	__acquire(RCU_BH);
+	rcu_read_acquire();
+}
 
 /*
  * 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() __rcu_read_unlock_bh()
+static inline void rcu_read_unlock_bh(void)
+{
+	rcu_read_release();
+	__release(RCU_BH);
+	__rcu_read_unlock_bh();
+}
 
 /**
  * rcu_read_lock_sched - mark the beginning of a RCU-classic critical section
@@ -160,10 +190,14 @@ extern int rcu_scheduler_active;
 static inline void rcu_read_lock_sched(void)
 {
 	preempt_disable();
+	__acquire(RCU_SCHED);
+	rcu_read_acquire();
 }
 static inline void rcu_read_lock_sched_notrace(void)
 {
 	preempt_disable_notrace();
+	__acquire(RCU_SCHED);
+	rcu_read_acquire();
 }
 
 /*
@@ -173,10 +207,14 @@ static inline void rcu_read_lock_sched_notrace(void)
  */
 static inline void rcu_read_unlock_sched(void)
 {
+	rcu_read_release();
+	__release(RCU_SCHED);
 	preempt_enable();
 }
 static inline void rcu_read_unlock_sched_notrace(void)
 {
+	rcu_read_release();
+	__release(RCU_SCHED);
 	preempt_enable_notrace();
 }
 
diff --git a/include/linux/rcupreempt.h b/include/linux/rcupreempt.h
index 2963f08..6c9dd9c 100644
--- a/include/linux/rcupreempt.h
+++ b/include/linux/rcupreempt.h
@@ -64,8 +64,8 @@ static inline void rcu_bh_qs(int cpu) { }
 extern void call_rcu_sched(struct rcu_head *head,
 			   void (*func)(struct rcu_head *head));
 
-extern void __rcu_read_lock(void)	__acquires(RCU);
-extern void __rcu_read_unlock(void)	__releases(RCU);
+extern void __rcu_read_lock(void);
+extern void __rcu_read_unlock(void);
 extern int rcu_pending(int cpu);
 extern int rcu_needs_cpu(int cpu);
 
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index a0852d0..8a0222c 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -36,38 +36,20 @@ extern void rcu_bh_qs(int cpu);
 extern int rcu_pending(int cpu);
 extern int rcu_needs_cpu(int cpu);
 
-#ifdef CONFIG_DEBUG_LOCK_ALLOC
-extern struct lockdep_map rcu_lock_map;
-# define rcu_read_acquire()	\
-			lock_acquire(&rcu_lock_map, 0, 0, 2, 1, NULL, _THIS_IP_)
-# define rcu_read_release()	lock_release(&rcu_lock_map, 1, _THIS_IP_)
-#else
-# define rcu_read_acquire()	do { } while (0)
-# define rcu_read_release()	do { } while (0)
-#endif
-
 static inline void __rcu_read_lock(void)
 {
 	preempt_disable();
-	__acquire(RCU);
-	rcu_read_acquire();
 }
 static inline void __rcu_read_unlock(void)
 {
-	rcu_read_release();
-	__release(RCU);
 	preempt_enable();
 }
 static inline void __rcu_read_lock_bh(void)
 {
 	local_bh_disable();
-	__acquire(RCU_BH);
-	rcu_read_acquire();
 }
 static inline void __rcu_read_unlock_bh(void)
 {
-	rcu_read_release();
-	__release(RCU_BH);
 	local_bh_enable();
 }
 

  reply	other threads:[~2009-08-23  9:02 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-27 18:14 [PATCH RFC -tip 0/4] v2 RCU cleanups and simplified preemptable RCU Paul E. McKenney
2009-07-27 18:16 ` [PATCH RFC -tip 1/4] v2 Move private definitions from include/linux/rcutree.h to kernel/rcutree.h Paul E. McKenney
2009-07-27 18:16 ` [PATCH RFC -tip 2/4] v2 Renamings to increase RCU clarity Paul E. McKenney
2009-07-27 18:16 ` [PATCH RFC -tip 3/4] v2 Consolidate sparse and lockdep declarations in include/linux/rcupdate.h Paul E. McKenney
2009-07-27 18:16 ` [PATCH RFC -tip 4/4] v2 Merge preemptable-RCU functionality into hierarchical RCU Paul E. McKenney
2009-08-03  8:20 ` [PATCH RFC -tip 0/4] v2 RCU cleanups and simplified preemptable RCU Ingo Molnar
2009-08-03 13:03   ` Paul E. McKenney
2009-08-22 20:56 ` [PATCH -tip] v3 Move private definitions from include/linux/rcutree.h to kernel/rcutree.h Paul E. McKenney
2009-08-23  9:01   ` [tip:core/rcu] rcu: " tip-bot for Paul E. McKenney
2009-08-22 20:56 ` [PATCH -tip] v3 Renamings to increase RCU clarity Paul E. McKenney
2009-08-23  9:01   ` [tip:core/rcu] rcu: " tip-bot for Paul E. McKenney
2009-08-24  7:17   ` [PATCH -tip] v3 " Lai Jiangshan
2009-08-24 15:36     ` Paul E. McKenney
2009-08-22 20:56 ` [PATCH -tip] v3 Consolidate sparse and lockdep declarations in include/linux/rcupdate.h Paul E. McKenney
2009-08-23  9:02   ` tip-bot for Paul E. McKenney [this message]
2009-08-23 18:42     ` [tip:core/rcu] rcu: " Ingo Molnar
2009-08-23 19:33       ` Paul E. McKenney
2009-08-23 22:53         ` Paul E. McKenney
2009-08-24  9:28           ` Ingo Molnar
2009-08-24 16:07             ` Paul E. McKenney
2009-08-24  7:34   ` [PATCH -tip] v3 " Lai Jiangshan
2009-08-24  9:00     ` Ingo Molnar
2009-08-24 16:03     ` Paul E. McKenney
2009-08-22 20:56 ` [PATCH -tip] v3 Fix online/offline indication for rcudata.csv trace file Paul E. McKenney
2009-08-23  9:02   ` [tip:core/rcu] rcu: " tip-bot for Paul E. McKenney
2009-08-22 20:56 ` [PATCH -tip] v3 Merge per-RCU-flavor initialization into pre-existing macro Paul E. McKenney
2009-08-23  9:02   ` [tip:core/rcu] rcu: " tip-bot for Paul E. McKenney
2009-08-22 20:56 ` [PATCH -tip] v3 Use debugfs_remove_recursive() simplify code Paul E. McKenney
2009-08-23  9:02   ` [tip:core/rcu] rcu: " tip-bot for Paul E. McKenney
2009-08-22 20:56 ` [PATCH -tip] v3 Simplify rcu_pending()/rcu_check_callbacks() API Paul E. McKenney
2009-08-23  9:02   ` [tip:core/rcu] rcu: " tip-bot for Paul E. McKenney
2009-08-24  7:10   ` [PATCH -tip] v3 " Peter Zijlstra
2009-08-24 15:42     ` Paul E. McKenney
2009-08-22 20:56 ` [PATCH -tip] v3 Merge preemptable-RCU functionality into hierarchical RCU Paul E. McKenney
2009-08-23  9:03   ` [tip:core/rcu] rcu: " tip-bot for Paul E. McKenney
2009-08-22 20:56 ` [PATCH -tip] v3 Remove CONFIG_PREEMPT_RCU Paul E. McKenney
2009-08-23  9:03   ` [tip:core/rcu] rcu: " tip-bot for Paul E. McKenney
2009-08-24  7:21 ` [PATCH RFC -tip 0/4] v3 RCU cleanups and simplified preemptable RCU Peter Zijlstra
2009-08-24 15:59   ` Paul E. McKenney

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=tip-bc33f24bdca8b6e97376e3a182ab69e6cdefa989@git.kernel.org \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    /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