[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] rcupdate: Implement rcu_barrier() to synchronously flush RCU work.



# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1295014602 0
# Node ID bb0d0141ebf7f4ffec54c0c5775e964a41978a4c
# Parent  2d4fe1a048cd8ae4c8aa0a50f65d0211c8ecf4d2
rcupdate: Implement rcu_barrier() to synchronously flush RCU work.

Signed-off-by: Keir Fraser <keir@xxxxxxx>
---
 xen/common/rcupdate.c      |   25 +++++++++++++++++++++++++
 xen/include/xen/rcupdate.h |    2 ++
 2 files changed, 27 insertions(+)

diff -r 2d4fe1a048cd -r bb0d0141ebf7 xen/common/rcupdate.c
--- a/xen/common/rcupdate.c     Fri Jan 14 14:16:04 2011 +0000
+++ b/xen/common/rcupdate.c     Fri Jan 14 14:16:42 2011 +0000
@@ -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 = {
@@ -59,6 +60,30 @@ static int qhimark = 10000;
 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 -r 2d4fe1a048cd -r bb0d0141ebf7 xen/include/xen/rcupdate.h
--- a/xen/include/xen/rcupdate.h        Fri Jan 14 14:16:04 2011 +0000
+++ b/xen/include/xen/rcupdate.h        Fri Jan 14 14:16:42 2011 +0000
@@ -197,4 +197,6 @@ void fastcall call_rcu(struct rcu_head *
 void fastcall call_rcu(struct rcu_head *head, 
                        void (*func)(struct rcu_head *head));
 
+int rcu_barrier(void);
+
 #endif /* __XEN_RCUPDATE_H */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.