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

[Xen-changelog] [xen-unstable] rcu: move private declarations and definitions from header to implementation



# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1318580199 -7200
# Node ID e2f6af2820f117bd40ac8e9cfc90f060dabad76e
# Parent  de316831471a8e0f11f615e7bf336dee2ba811e7
rcu: move private declarations and definitions from header to implementation

No consumer of RCU should need to see these, and there's also no need
to clutter the global name space with them.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
---


diff -r de316831471a -r e2f6af2820f1 xen/common/rcupdate.c
--- a/xen/common/rcupdate.c     Fri Oct 14 10:15:54 2011 +0200
+++ b/xen/common/rcupdate.c     Fri Oct 14 10:16:39 2011 +0200
@@ -46,15 +46,50 @@
 #include <xen/cpu.h>
 #include <xen/stop_machine.h>
 
-/* Definition for rcupdate control block. */
-struct rcu_ctrlblk rcu_ctrlblk = {
+/* Global control variables for rcupdate callback mechanism. */
+static struct rcu_ctrlblk {
+    long cur;           /* Current batch number.                      */
+    long completed;     /* Number of the last completed batch         */
+    int  next_pending;  /* Is the next batch already waiting?         */
+
+    spinlock_t  lock __cacheline_aligned;
+    cpumask_t   cpumask; /* CPUs that need to switch in order    */
+    /* for current batch to proceed.        */
+} __cacheline_aligned rcu_ctrlblk = {
     .cur = -300,
     .completed = -300,
     .lock = SPIN_LOCK_UNLOCKED,
     .cpumask = CPU_MASK_NONE,
 };
 
-DEFINE_PER_CPU(struct rcu_data, rcu_data);
+/*
+ * Per-CPU data for Read-Copy Update.
+ * nxtlist - new callbacks are added here
+ * curlist - current batch for which quiescent cycle started if any
+ */
+struct rcu_data {
+    /* 1) quiescent state handling : */
+    long quiescbatch;    /* Batch # for grace period */
+    int  qs_pending;     /* core waits for quiesc state */
+
+    /* 2) batch handling */
+    long            batch;            /* Batch # for current RCU batch */
+    struct rcu_head *nxtlist;
+    struct rcu_head **nxttail;
+    long            qlen;             /* # of queued callbacks */
+    struct rcu_head *curlist;
+    struct rcu_head **curtail;
+    struct rcu_head *donelist;
+    struct rcu_head **donetail;
+    long            blimit;           /* Upper limit on a processed batch */
+    int cpu;
+    struct rcu_head barrier;
+#ifdef CONFIG_SMP
+    long            last_rs_qlen;     /* qlen during the last resched */
+#endif
+};
+
+static DEFINE_PER_CPU(struct rcu_data, rcu_data);
 
 static int blimit = 10;
 static int qhimark = 10000;
@@ -104,6 +139,18 @@
     return stop_machine_run(rcu_barrier_action, &cpu_count, NR_CPUS);
 }
 
+/* Is batch a before batch b ? */
+static inline int rcu_batch_before(long a, long b)
+{
+    return (a - b) < 0;
+}
+
+/* Is batch a after batch b ? */
+static inline int rcu_batch_after(long a, long b)
+{
+    return (a - b) > 0;
+}
+
 static void force_quiescent_state(struct rcu_data *rdp,
                                   struct rcu_ctrlblk *rcp)
 {
diff -r de316831471a -r e2f6af2820f1 xen/include/xen/rcupdate.h
--- a/xen/include/xen/rcupdate.h        Fri Oct 14 10:15:54 2011 +0200
+++ b/xen/include/xen/rcupdate.h        Fri Oct 14 10:16:39 2011 +0200
@@ -57,60 +57,6 @@
 } while (0)
 
 
-
-/* Global control variables for rcupdate callback mechanism. */
-struct rcu_ctrlblk {
-    long cur;           /* Current batch number.                      */
-    long completed;     /* Number of the last completed batch         */
-    int  next_pending;  /* Is the next batch already waiting?         */
-
-    spinlock_t  lock __cacheline_aligned;
-    cpumask_t   cpumask; /* CPUs that need to switch in order    */
-    /* for current batch to proceed.        */
-} __cacheline_aligned;
-
-/* Is batch a before batch b ? */
-static inline int rcu_batch_before(long a, long b)
-{
-    return (a - b) < 0;
-}
-
-/* Is batch a after batch b ? */
-static inline int rcu_batch_after(long a, long b)
-{
-    return (a - b) > 0;
-}
-
-/*
- * Per-CPU data for Read-Copy Update.
- * nxtlist - new callbacks are added here
- * curlist - current batch for which quiescent cycle started if any
- */
-struct rcu_data {
-    /* 1) quiescent state handling : */
-    long quiescbatch;    /* Batch # for grace period */
-    int  qs_pending;     /* core waits for quiesc state */
-
-    /* 2) batch handling */
-    long            batch;            /* Batch # for current RCU batch */
-    struct rcu_head *nxtlist;
-    struct rcu_head **nxttail;
-    long            qlen;             /* # of queued callbacks */
-    struct rcu_head *curlist;
-    struct rcu_head **curtail;
-    struct rcu_head *donelist;
-    struct rcu_head **donetail;
-    long            blimit;           /* Upper limit on a processed batch */
-    int cpu;
-    struct rcu_head barrier;
-#ifdef CONFIG_SMP
-    long            last_rs_qlen;     /* qlen during the last resched */
-#endif
-};
-
-DECLARE_PER_CPU(struct rcu_data, rcu_data);
-extern struct rcu_ctrlblk rcu_ctrlblk;
-
 int rcu_pending(int cpu);
 int rcu_needs_cpu(int cpu);
 

_______________________________________________
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®.