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

[PATCH v2 3/3] xen/rcu: remove rcu_quiesce_{disable,enable}()



Fold the code into its callers, having them as separate function just makes
the code harder to read.  Rename rcu_quiesce_allowed() as the RCU
implementation no longer has the concept of quiesce periods.

No functional change intended.

Signed-off-by: Roger Pau Monné <roger@xxxxxxxxxxxxxx>
---
Changes since v2:
 - New in this version.
---
 xen/common/softirq.c       |  4 ++--
 xen/include/xen/rcupdate.h | 32 +++++++++++---------------------
 2 files changed, 13 insertions(+), 23 deletions(-)

diff --git a/xen/common/softirq.c b/xen/common/softirq.c
index dc3aabce3330..39e1a9844afa 100644
--- a/xen/common/softirq.c
+++ b/xen/common/softirq.c
@@ -31,7 +31,7 @@ static void __do_softirq(unsigned long ignore_mask)
     unsigned long pending;
     bool rcu_allowed = !(ignore_mask & (1UL << RCU_SOFTIRQ));
 
-    ASSERT(!rcu_allowed || rcu_quiesce_allowed());
+    ASSERT(!rcu_allowed || rcu_processing_allowed());
 
     for ( ; ; )
     {
@@ -61,7 +61,7 @@ void process_pending_softirqs(void)
                                 (1UL << SCHED_SLAVE_SOFTIRQ);
 
     /* Block RCU processing in case of rcu_read_lock() held. */
-    if ( !rcu_quiesce_allowed() )
+    if ( !rcu_processing_allowed() )
         ignore_mask |= 1UL << RCU_SOFTIRQ;
 
     ASSERT(!in_irq() && local_irq_is_enabled());
diff --git a/xen/include/xen/rcupdate.h b/xen/include/xen/rcupdate.h
index 312551d5b089..cb16d7f79ae8 100644
--- a/xen/include/xen/rcupdate.h
+++ b/xen/include/xen/rcupdate.h
@@ -46,24 +46,7 @@ DECLARE_PER_CPU(unsigned int, rcu_lock_epoch);
 
 extern unsigned int rcu_epoch;
 
-static inline void rcu_quiesce_disable(void)
-{
-    unsigned int cpu = smp_processor_id();
-
-    preempt_disable();
-    if ( !ACCESS_ONCE(per_cpu(rcu_lock_cnt, cpu))++ )
-        ACCESS_ONCE(per_cpu(rcu_lock_epoch, cpu)) = ACCESS_ONCE(rcu_epoch);
-    smp_mb();
-}
-
-static inline void rcu_quiesce_enable(void)
-{
-    smp_mb();
-    ACCESS_ONCE(this_cpu(rcu_lock_cnt))--;
-    preempt_enable();
-}
-
-static inline bool rcu_quiesce_allowed(void)
+static inline bool rcu_processing_allowed(void)
 {
     return !this_cpu(rcu_lock_cnt);
 }
@@ -129,7 +112,12 @@ typedef struct _rcu_read_lock rcu_read_lock_t;
  */
 static inline void rcu_read_lock(rcu_read_lock_t *lock)
 {
-    rcu_quiesce_disable();
+    unsigned int cpu = smp_processor_id();
+
+    preempt_disable();
+    if ( !ACCESS_ONCE(per_cpu(rcu_lock_cnt, cpu))++ )
+        ACCESS_ONCE(per_cpu(rcu_lock_epoch, cpu)) = ACCESS_ONCE(rcu_epoch);
+    smp_mb();
 }
 
 /**
@@ -139,8 +127,10 @@ static inline void rcu_read_lock(rcu_read_lock_t *lock)
  */
 static inline void rcu_read_unlock(rcu_read_lock_t *lock)
 {
-    ASSERT(!rcu_quiesce_allowed());
-    rcu_quiesce_enable();
+    ASSERT(!rcu_processing_allowed());
+    smp_mb();
+    ACCESS_ONCE(this_cpu(rcu_lock_cnt))--;
+    preempt_enable();
 }
 
 /*
-- 
2.55.0




 


Rackspace

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