Commit ea7d3fef4222cd98556a0b386598268d4dbf6670
Committed by
Ingo Molnar
1 parent
90a4d2c010
Exists in
master
and in
4 other branches
rcu: eliminate synchronize_rcu_xxx macro
Impact: cleanup Expand macro into two files. The synchronize_rcu_xxx macro is quite ugly and it's only used by two callers, so expand it instead. This makes this code easier to change. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Showing 3 changed files with 19 additions and 15 deletions Side-by-side Diff
include/linux/rcupdate.h
... | ... | @@ -204,18 +204,6 @@ |
204 | 204 | |
205 | 205 | extern void wakeme_after_rcu(struct rcu_head *head); |
206 | 206 | |
207 | -#define synchronize_rcu_xxx(name, func) \ | |
208 | -void name(void) \ | |
209 | -{ \ | |
210 | - struct rcu_synchronize rcu; \ | |
211 | - \ | |
212 | - init_completion(&rcu.completion); \ | |
213 | - /* Will wake me after RCU finished. */ \ | |
214 | - func(&rcu.head, wakeme_after_rcu); \ | |
215 | - /* Wait for it. */ \ | |
216 | - wait_for_completion(&rcu.completion); \ | |
217 | -} | |
218 | - | |
219 | 207 | /** |
220 | 208 | * synchronize_sched - block until all CPUs have exited any non-preemptive |
221 | 209 | * kernel code sequences. |
kernel/rcupdate.c
... | ... | @@ -77,8 +77,15 @@ |
77 | 77 | * sections are delimited by rcu_read_lock() and rcu_read_unlock(), |
78 | 78 | * and may be nested. |
79 | 79 | */ |
80 | -void synchronize_rcu(void); /* Makes kernel-doc tools happy */ | |
81 | -synchronize_rcu_xxx(synchronize_rcu, call_rcu) | |
80 | +void synchronize_rcu(void) | |
81 | +{ | |
82 | + struct rcu_synchronize rcu; | |
83 | + init_completion(&rcu.completion); | |
84 | + /* Will wake me after RCU finished. */ | |
85 | + call_rcu(&rcu.head, wakeme_after_rcu); | |
86 | + /* Wait for it. */ | |
87 | + wait_for_completion(&rcu.completion); | |
88 | +} | |
82 | 89 | EXPORT_SYMBOL_GPL(synchronize_rcu); |
83 | 90 | |
84 | 91 | static void rcu_barrier_callback(struct rcu_head *notused) |
kernel/rcupreempt.c
... | ... | @@ -1177,7 +1177,16 @@ |
1177 | 1177 | * in -rt this does -not- necessarily result in all currently executing |
1178 | 1178 | * interrupt -handlers- having completed. |
1179 | 1179 | */ |
1180 | -synchronize_rcu_xxx(__synchronize_sched, call_rcu_sched) | |
1180 | +void __synchronize_sched(void) | |
1181 | +{ | |
1182 | + struct rcu_synchronize rcu; | |
1183 | + | |
1184 | + init_completion(&rcu.completion); | |
1185 | + /* Will wake me after RCU finished. */ | |
1186 | + call_rcu_sched(&rcu.head, wakeme_after_rcu); | |
1187 | + /* Wait for it. */ | |
1188 | + wait_for_completion(&rcu.completion); | |
1189 | +} | |
1181 | 1190 | EXPORT_SYMBOL_GPL(__synchronize_sched); |
1182 | 1191 | |
1183 | 1192 | /* |