diff options
author | Keir Fraser <keir@xen.org> | 2011-01-14 14:16:42 +0000 |
---|---|---|
committer | Keir Fraser <keir@xen.org> | 2011-01-14 14:16:42 +0000 |
commit | 24273c92be16bab4d48561a0d892463a544b0a4a (patch) | |
tree | 962bc5ca5f9dd81afb078396151d68736331d754 | |
parent | 28c7ad54f50ec385f5ae6f5323801e8c0dd8b2cf (diff) | |
download | xen-24273c92be16bab4d48561a0d892463a544b0a4a.tar.gz xen-24273c92be16bab4d48561a0d892463a544b0a4a.tar.bz2 xen-24273c92be16bab4d48561a0d892463a544b0a4a.zip |
rcupdate: Implement rcu_barrier() to synchronously flush RCU work.
Signed-off-by: Keir Fraser <keir@xen.org>
-rw-r--r-- | xen/common/rcupdate.c | 25 | ||||
-rw-r--r-- | xen/include/xen/rcupdate.h | 2 |
2 files changed, 27 insertions, 0 deletions
diff --git a/xen/common/rcupdate.c b/xen/common/rcupdate.c index b93c1db697..9087a56d9c 100644 --- a/xen/common/rcupdate.c +++ b/xen/common/rcupdate.c @@ -44,6 +44,7 @@ #include <xen/percpu.h> #include <xen/softirq.h> #include <xen/cpu.h> +#include <xen/stop_machine.h> /* Definition for rcupdate control block. */ struct rcu_ctrlblk rcu_ctrlblk = { @@ -60,6 +61,30 @@ static int qhimark = 10000; static int qlowmark = 100; static int rsinterval = 1000; +static int rcu_barrier_action(void *unused) +{ + unsigned int cpu = smp_processor_id(); + + ASSERT(!local_irq_is_enabled()); + local_irq_enable(); + + while ( rcu_needs_cpu(cpu) ) + { + rcu_check_callbacks(cpu); + process_pending_softirqs(); + cpu_relax(); + } + + local_irq_disable(); + + return 0; +} + +int rcu_barrier(void) +{ + return stop_machine_run(rcu_barrier_action, NULL, NR_CPUS); +} + static void force_quiescent_state(struct rcu_data *rdp, struct rcu_ctrlblk *rcp) { diff --git a/xen/include/xen/rcupdate.h b/xen/include/xen/rcupdate.h index bb4af9d6e0..09802bd622 100644 --- a/xen/include/xen/rcupdate.h +++ b/xen/include/xen/rcupdate.h @@ -197,4 +197,6 @@ void rcu_check_callbacks(int cpu); void fastcall call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *head)); +int rcu_barrier(void); + #endif /* __XEN_RCUPDATE_H */ |