]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
rcu: shrink rcutiny by making synchronize_rcu_bh() be inline
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 30 Mar 2010 22:46:01 +0000 (15:46 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 10 May 2010 18:08:32 +0000 (11:08 -0700)
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
include/linux/rcutiny.h
include/linux/rcutree.h
kernel/rcutiny.c

index 02537a72aaa44b052866d496c7c6bc4bac423a3c..d8fb2abcf30339dd5a78f922452d3b8a0b91f034 100644 (file)
@@ -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);
index a5195875480aa299d96e0649f524a184cdd88413..bbeb55b7709bb55cf881bfaf643da2a373629ca4 100644 (file)
@@ -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)
 {
index 42cc3a04779ee1376adce84aeb57655df656d06f..7484fe66a3aad36fbb0c307e2c54682bacbab8e9 100644 (file)
@@ -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)
index 9f6d9ff2572cddf3067a3a4434f5a86612a94a44..272c6d21a75f3f80428be7b4ae6b26ca62580bc0 100644 (file)
@@ -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().
  */