diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-15 16:59:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-15 16:59:31 -0400 |
commit | 64fd52a52077d3cd5a778ca031c0aaecf885eaa6 (patch) | |
tree | 00d72f4aac587eeeff89b8af369250725bf83c6a /include/linux/rcupdate.h | |
parent | fe1a6875fcaaac2041945008a9875d2c07be1d9b (diff) | |
parent | 6c9fcaf2eec1b9f85226a694230dd957dd7926b3 (diff) |
Merge branch 'core/rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core/rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (23 commits)
rcu classic: update qlen when cpu offline
rcu: make rcutorture even more vicious: invoke RCU readers from irq handlers (timers)
rcu: make quiescent rcutorture less power-hungry
rcu, rcutorture: make quiescent rcutorture less power-hungry
rcu: make rcutorture more vicious: reinstate boot-time testing
rcu: make rcutorture more vicious: add stutter feature
rcutorture: WARN_ON_ONCE(1) when detecting an error
rcu: remove unused field struct rcu_data::rcu_tasklet
Revert "prohibit rcutorture from being compiled into the kernel"
rcu: fix nf_conntrack_helper.c build bug
rculist.h: fix include in net/netfilter/nf_conntrack_netlink.c
rcu: remove duplicated include in kernel/rcupreempt.c
rcu: remove duplicated include in kernel/rcupreempt_trace.c
RCU, rculist.h: fix list iterators
rcu: fix rcu_try_flip_waitack_needed() to prevent grace-period stall
rculist.h: use the rcu API
rcu: split list.h and move rcu-protected lists into rculist.h
sched: 1Q08 RCU doc update, add call_rcu_sched()
rcu: add call_rcu_sched() and friends to rcutorture
rcu: add rcu_barrier_sched() and rcu_barrier_bh()
...
Diffstat (limited to 'include/linux/rcupdate.h')
-rw-r--r-- | include/linux/rcupdate.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index d42dbec06083..e8b4039cfb2f 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <linux/cpumask.h> | 40 | #include <linux/cpumask.h> |
41 | #include <linux/seqlock.h> | 41 | #include <linux/seqlock.h> |
42 | #include <linux/lockdep.h> | 42 | #include <linux/lockdep.h> |
43 | #include <linux/completion.h> | ||
43 | 44 | ||
44 | /** | 45 | /** |
45 | * struct rcu_head - callback structure for use with RCU | 46 | * struct rcu_head - callback structure for use with RCU |
@@ -168,6 +169,27 @@ struct rcu_head { | |||
168 | (p) = (v); \ | 169 | (p) = (v); \ |
169 | }) | 170 | }) |
170 | 171 | ||
172 | /* Infrastructure to implement the synchronize_() primitives. */ | ||
173 | |||
174 | struct rcu_synchronize { | ||
175 | struct rcu_head head; | ||
176 | struct completion completion; | ||
177 | }; | ||
178 | |||
179 | extern void wakeme_after_rcu(struct rcu_head *head); | ||
180 | |||
181 | #define synchronize_rcu_xxx(name, func) \ | ||
182 | void name(void) \ | ||
183 | { \ | ||
184 | struct rcu_synchronize rcu; \ | ||
185 | \ | ||
186 | init_completion(&rcu.completion); \ | ||
187 | /* Will wake me after RCU finished. */ \ | ||
188 | func(&rcu.head, wakeme_after_rcu); \ | ||
189 | /* Wait for it. */ \ | ||
190 | wait_for_completion(&rcu.completion); \ | ||
191 | } | ||
192 | |||
171 | /** | 193 | /** |
172 | * synchronize_sched - block until all CPUs have exited any non-preemptive | 194 | * synchronize_sched - block until all CPUs have exited any non-preemptive |
173 | * kernel code sequences. | 195 | * kernel code sequences. |
@@ -224,8 +246,8 @@ extern void call_rcu_bh(struct rcu_head *head, | |||
224 | /* Exported common interfaces */ | 246 | /* Exported common interfaces */ |
225 | extern void synchronize_rcu(void); | 247 | extern void synchronize_rcu(void); |
226 | extern void rcu_barrier(void); | 248 | extern void rcu_barrier(void); |
227 | extern long rcu_batches_completed(void); | 249 | extern void rcu_barrier_bh(void); |
228 | extern long rcu_batches_completed_bh(void); | 250 | extern void rcu_barrier_sched(void); |
229 | 251 | ||
230 | /* Internal to kernel */ | 252 | /* Internal to kernel */ |
231 | extern void rcu_init(void); | 253 | extern void rcu_init(void); |