mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: mingo@elte.hu, laijs@cn.fujitsu.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca,
	josh@joshtriplett.org, dvhltc@us.ibm.com, niv@us.ibm.com,
	tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org,
	Valdis.Kletnieks@vt.edu, dhowells@redhat.com,
	eric.dumazet@gmail.com,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: [PATCH tip/core/rcu 07/23] rcu: shrink rcutiny by making synchronize_rcu_bh() be inline
Date: Tue, 20 Apr 2010 14:44:39 -0700	[thread overview]
Message-ID: <1271799895-21028-7-git-send-email-paulmck@linux.vnet.ibm.com> (raw)
In-Reply-To: <20100420214431.GA20777@linux.vnet.ibm.com>

Because synchronize_rcu_bh() is identical to synchronize_sched(),
make the former a static inline invoking the latter, saving the
overhead of an EXPORT_SYMBOL_GPL() and the duplicate code.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 include/linux/rcupdate.h |    2 --
 include/linux/rcutiny.h  |   12 +++++++++++-
 include/linux/rcutree.h  |    2 ++
 kernel/rcutiny.c         |    9 ++-------
 4 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 07c8591..08a04b1 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -56,8 +56,6 @@ struct rcu_head {
 };
 
 /* Exported common interfaces */
-extern void synchronize_rcu_bh(void);
-extern void synchronize_sched(void);
 extern void rcu_barrier(void);
 extern void rcu_barrier_bh(void);
 extern void rcu_barrier_sched(void);
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
index a519587..bbeb55b 100644
--- a/include/linux/rcutiny.h
+++ b/include/linux/rcutiny.h
@@ -74,7 +74,17 @@ static inline void rcu_sched_force_quiescent_state(void)
 {
 }
 
-#define synchronize_rcu synchronize_sched
+extern void synchronize_sched(void);
+
+static inline void synchronize_rcu(void)
+{
+	synchronize_sched();
+}
+
+static inline void synchronize_rcu_bh(void)
+{
+	synchronize_sched();
+}
 
 static inline void synchronize_rcu_expedited(void)
 {
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index 42cc3a0..7484fe6 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -86,6 +86,8 @@ static inline void __rcu_read_unlock_bh(void)
 
 extern void call_rcu_sched(struct rcu_head *head,
 			   void (*func)(struct rcu_head *rcu));
+extern void synchronize_rcu_bh(void);
+extern void synchronize_sched(void);
 extern void synchronize_rcu_expedited(void);
 
 static inline void synchronize_rcu_bh_expedited(void)
diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c
index 9f6d9ff..272c6d2 100644
--- a/kernel/rcutiny.c
+++ b/kernel/rcutiny.c
@@ -187,7 +187,8 @@ static void rcu_process_callbacks(struct softirq_action *unused)
  *
  * Cool, huh?  (Due to Josh Triplett.)
  *
- * But we want to make this a static inline later.
+ * But we want to make this a static inline later.  The cond_resched()
+ * currently makes this problematic.
  */
 void synchronize_sched(void)
 {
@@ -195,12 +196,6 @@ void synchronize_sched(void)
 }
 EXPORT_SYMBOL_GPL(synchronize_sched);
 
-void synchronize_rcu_bh(void)
-{
-	synchronize_sched();
-}
-EXPORT_SYMBOL_GPL(synchronize_rcu_bh);
-
 /*
  * Helper function for call_rcu() and call_rcu_bh().
  */
-- 
1.7.0


  parent reply	other threads:[~2010-04-20 21:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-20 21:44 [PATCH tip/core/rcu 0/23] v3 patches queued for 2.6.35 Paul E. McKenney
2010-04-20 21:44 ` [PATCH tip/core/rcu 01/23] rcu: substitute set_need_resched for sending resched IPIs Paul E. McKenney
2010-04-20 21:44 ` [PATCH tip/core/rcu 02/23] rcu: make dead code really dead Paul E. McKenney
2010-04-20 21:44 ` [PATCH tip/core/rcu 03/23] rcu: move some code from macro to function Paul E. McKenney
2010-04-20 21:44 ` [PATCH tip/core/rcu 04/23] rcu: ignore offline CPUs in last non-dyntick-idle CPU check Paul E. McKenney
2010-04-20 21:44 ` [PATCH tip/core/rcu 05/23] rcu: Fix bogus CONFIG_PROVE_LOCKING in comments to reflect reality Paul E. McKenney
2010-04-20 21:44 ` [PATCH tip/core/rcu 06/23] rcu: fix now-bogus rcu_scheduler_active comments Paul E. McKenney
2010-04-20 21:44 ` Paul E. McKenney [this message]
2010-04-20 21:44 ` [PATCH tip/core/rcu 08/23] rcu: rename rcutiny rcu_ctrlblk to rcu_sched_ctrlblk Paul E. McKenney
2010-04-20 21:44 ` [PATCH tip/core/rcu 09/23] rcu: refactor RCU's context-switch handling Paul E. McKenney
2010-04-20 21:44 ` [PATCH tip/core/rcu 10/23] rcu: slim down rcutiny by removing rcu_scheduler_active and friends Paul E. McKenney
2010-04-20 21:44 ` [PATCH tip/core/rcu 11/23] rcu: enable CPU_STALL_VERBOSE by default Paul E. McKenney
2010-04-20 21:44 ` [PATCH tip/core/rcu 12/23] rcu: disable CPU stall warnings upon panic Paul E. McKenney
2010-04-20 21:44 ` [PATCH tip/core/rcu 13/23] rcu: print boot-time console messages if RCU configs out of ordinary Paul E. McKenney
2010-04-20 21:44 ` [PATCH tip/core/rcu 14/23] rcu: improve RCU CPU stall-warning messages Paul E. McKenney
2010-04-20 21:44 ` [PATCH tip/core/rcu 15/23] rcu: permit discontiguous cpu_possible_mask CPU numbering Paul E. McKenney
2010-04-20 21:44 ` [PATCH tip/core/rcu 16/23] rcu: v2: reduce the number of spurious RCU_SOFTIRQ invocations Paul E. McKenney
2010-04-20 21:44 ` [PATCH tip/core/rcu 17/23] rcu: improve the RCU CPU-stall warning documentation Paul E. McKenney
2010-04-20 21:44 ` [PATCH tip/core/rcu 18/23] Debugobjects transition check Paul E. McKenney
2010-04-20 21:44 ` [PATCH tip/core/rcu 19/23] rcu head introduce rcu head init on stack Paul E. McKenney
2010-04-20 21:44 ` [PATCH tip/core/rcu 20/23] remove all rcu head initializations, except on_stack initializations Paul E. McKenney
2010-04-20 21:44 ` [PATCH tip/core/rcu 21/23] rcu head remove init Paul E. McKenney
2010-04-20 21:44 ` [PATCH tip/core/rcu 22/23] tree/tiny rcu: Add debug RCU head objects (v5) Paul E. McKenney
2010-04-20 21:44 ` [PATCH tip/core/rcu 23/23] rcu: make SRCU usable in modules 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=1271799895-21028-7-git-send-email-paulmck@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=dvhltc@us.ibm.com \
    --cc=eric.dumazet@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=mingo@elte.hu \
    --cc=niv@us.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --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

all inboxes | Powered by JetHome®