diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2010-03-30 18:46:01 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2010-05-10 14:08:32 -0400 |
commit | da848c47bc6e873a54a445ea1960423a495b6b32 (patch) | |
tree | 4c0eaef1a5990585730f00caca0cfcba21fe9f9f | |
parent | 32c141a0a1dfa29e0a07d78bec0c0919fc4b9f88 (diff) |
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>
-rw-r--r-- | include/linux/rcupdate.h | 2 | ||||
-rw-r--r-- | include/linux/rcutiny.h | 12 | ||||
-rw-r--r-- | include/linux/rcutree.h | 2 | ||||
-rw-r--r-- | kernel/rcutiny.c | 9 |
4 files changed, 15 insertions, 10 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 02537a72aaa4..d8fb2abcf303 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -56,8 +56,6 @@ struct rcu_head { | |||
56 | }; | 56 | }; |
57 | 57 | ||
58 | /* Exported common interfaces */ | 58 | /* Exported common interfaces */ |
59 | extern void synchronize_rcu_bh(void); | ||
60 | extern void synchronize_sched(void); | ||
61 | extern void rcu_barrier(void); | 59 | extern void rcu_barrier(void); |
62 | extern void rcu_barrier_bh(void); | 60 | extern void rcu_barrier_bh(void); |
63 | extern void rcu_barrier_sched(void); | 61 | extern void rcu_barrier_sched(void); |
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index a5195875480a..bbeb55b7709b 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h | |||
@@ -74,7 +74,17 @@ static inline void rcu_sched_force_quiescent_state(void) | |||
74 | { | 74 | { |
75 | } | 75 | } |
76 | 76 | ||
77 | #define synchronize_rcu synchronize_sched | 77 | extern void synchronize_sched(void); |
78 | |||
79 | static inline void synchronize_rcu(void) | ||
80 | { | ||
81 | synchronize_sched(); | ||
82 | } | ||
83 | |||
84 | static inline void synchronize_rcu_bh(void) | ||
85 | { | ||
86 | synchronize_sched(); | ||
87 | } | ||
78 | 88 | ||
79 | static inline void synchronize_rcu_expedited(void) | 89 | static inline void synchronize_rcu_expedited(void) |
80 | { | 90 | { |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 42cc3a04779e..7484fe66a3aa 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
@@ -86,6 +86,8 @@ static inline void __rcu_read_unlock_bh(void) | |||
86 | 86 | ||
87 | extern void call_rcu_sched(struct rcu_head *head, | 87 | extern void call_rcu_sched(struct rcu_head *head, |
88 | void (*func)(struct rcu_head *rcu)); | 88 | void (*func)(struct rcu_head *rcu)); |
89 | extern void synchronize_rcu_bh(void); | ||
90 | extern void synchronize_sched(void); | ||
89 | extern void synchronize_rcu_expedited(void); | 91 | extern void synchronize_rcu_expedited(void); |
90 | 92 | ||
91 | static inline void synchronize_rcu_bh_expedited(void) | 93 | static inline void synchronize_rcu_bh_expedited(void) |
diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c index 9f6d9ff2572c..272c6d21a75f 100644 --- a/kernel/rcutiny.c +++ b/kernel/rcutiny.c | |||
@@ -187,7 +187,8 @@ static void rcu_process_callbacks(struct softirq_action *unused) | |||
187 | * | 187 | * |
188 | * Cool, huh? (Due to Josh Triplett.) | 188 | * Cool, huh? (Due to Josh Triplett.) |
189 | * | 189 | * |
190 | * But we want to make this a static inline later. | 190 | * But we want to make this a static inline later. The cond_resched() |
191 | * currently makes this problematic. | ||
191 | */ | 192 | */ |
192 | void synchronize_sched(void) | 193 | void synchronize_sched(void) |
193 | { | 194 | { |
@@ -195,12 +196,6 @@ void synchronize_sched(void) | |||
195 | } | 196 | } |
196 | EXPORT_SYMBOL_GPL(synchronize_sched); | 197 | EXPORT_SYMBOL_GPL(synchronize_sched); |
197 | 198 | ||
198 | void synchronize_rcu_bh(void) | ||
199 | { | ||
200 | synchronize_sched(); | ||
201 | } | ||
202 | EXPORT_SYMBOL_GPL(synchronize_rcu_bh); | ||
203 | |||
204 | /* | 199 | /* |
205 | * Helper function for call_rcu() and call_rcu_bh(). | 200 | * Helper function for call_rcu() and call_rcu_bh(). |
206 | */ | 201 | */ |