浏览代码

rcu: shrink rcutiny by making synchronize_rcu_bh() be inline

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>
Paul E. McKenney 15 年之前
父节点
当前提交
da848c47bc
共有 4 个文件被更改,包括 15 次插入10 次删除
  1. 0 2
      include/linux/rcupdate.h
  2. 11 1
      include/linux/rcutiny.h
  3. 2 0
      include/linux/rcutree.h
  4. 2 7
      kernel/rcutiny.c

+ 0 - 2
include/linux/rcupdate.h

@@ -56,8 +56,6 @@ struct rcu_head {
 };
 };
 
 
 /* Exported common interfaces */
 /* Exported common interfaces */
-extern void synchronize_rcu_bh(void);
-extern void synchronize_sched(void);
 extern void rcu_barrier(void);
 extern void rcu_barrier(void);
 extern void rcu_barrier_bh(void);
 extern void rcu_barrier_bh(void);
 extern void rcu_barrier_sched(void);
 extern void rcu_barrier_sched(void);

+ 11 - 1
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)
 static inline void synchronize_rcu_expedited(void)
 {
 {

+ 2 - 0
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,
 extern void call_rcu_sched(struct rcu_head *head,
 			   void (*func)(struct rcu_head *rcu));
 			   void (*func)(struct rcu_head *rcu));
+extern void synchronize_rcu_bh(void);
+extern void synchronize_sched(void);
 extern void synchronize_rcu_expedited(void);
 extern void synchronize_rcu_expedited(void);
 
 
 static inline void synchronize_rcu_bh_expedited(void)
 static inline void synchronize_rcu_bh_expedited(void)

+ 2 - 7
kernel/rcutiny.c

@@ -187,7 +187,8 @@ static void rcu_process_callbacks(struct softirq_action *unused)
  *
  *
  * Cool, huh?  (Due to Josh Triplett.)
  * 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)
 void synchronize_sched(void)
 {
 {
@@ -195,12 +196,6 @@ void synchronize_sched(void)
 }
 }
 EXPORT_SYMBOL_GPL(synchronize_sched);
 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().
  * Helper function for call_rcu() and call_rcu_bh().
  */
  */