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

[PATCH 5/5] xen/rcu: remove rcu_needs_cpu()



After the changes to the RCU logic, there's no longer a difference between
rcu_pending() and rcu_needs_cpu().  With the previous implementation
rcu_pending() signaled whether there was RCU work ready to handle, while
rcu_needs_cpu() signaled whether the CPU had queued RCU callback that could
not yet execute.

With the new logic figuring out whether callbacks can be executed requires
more work, and hence is deferred to the processing logic in
rcu_process_callbacks().  Both rcu_pending() and rcu_needs_cpu() return
whether there's any pending work, without making guarantees any callbacks
are ready to be executed.

Given this lack of difference, remove rcu_needs_cpu() and use rcu_pending()
in cpu_is_haltable().

Signed-off-by: Roger Pau Monné <roger@xxxxxxxxxxxxxx>
---
 xen/common/rcupdate.c      | 11 -----------
 xen/include/xen/rcupdate.h |  7 +++++--
 xen/include/xen/sched.h    |  2 +-
 3 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/xen/common/rcupdate.c b/xen/common/rcupdate.c
index d3c11f45bfa0..c8164b0ad7e0 100644
--- a/xen/common/rcupdate.c
+++ b/xen/common/rcupdate.c
@@ -298,17 +298,6 @@ bool rcu_pending(unsigned int cpu)
     return !!per_cpu(rcu_data, cpu).nr;
 }
 
-/*
- * Check to see if any future RCU-related work will need to be done
- * by the current CPU, even if none need be done immediately, returning
- * true if so.  This function is part of the RCU implementation; it is -not-
- * an exported member of the RCU API.
- */
-bool rcu_needs_cpu(unsigned int cpu)
-{
-    return rcu_pending(cpu);
-}
-
 /*
  * Timer for making sure the CPU where a callback is queued does
  * periodically poke rcu_pending(), so that it will invoke the callback
diff --git a/xen/include/xen/rcupdate.h b/xen/include/xen/rcupdate.h
index 9c3e06bbe6e8..1700b73a6c3b 100644
--- a/xen/include/xen/rcupdate.h
+++ b/xen/include/xen/rcupdate.h
@@ -90,9 +90,12 @@ struct rcu_head {
     INIT_LIST_HEAD(&(ptr)->list); (ptr)->func = NULL; \
 } while (0)
 
-
+/*
+ * Check whether there's pending RCU work queued on this CPU.  This merely
+ * signals whether there are callbacks pending, there's no guarantee that any
+ * callbacks are ready to be executed.
+ */
 bool rcu_pending(unsigned int cpu);
-bool rcu_needs_cpu(unsigned int cpu);
 
 /*
  * Dummy lock type for passing to rcu_read_{lock,unlock}. Currently exists
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index e352e2b38e7d..5bccf9b748a6 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -1155,7 +1155,7 @@ void scheduler_disable(void);
  * the tasklet_work_to_do() helper).
  */
 #define cpu_is_haltable(cpu)                    \
-    (!rcu_needs_cpu(cpu) &&                     \
+    (!rcu_pending(cpu) &&                       \
      !softirq_pending(cpu) &&                   \
      cpu_online(cpu) &&                         \
      !per_cpu(tasklet_work_to_do, cpu))
-- 
2.53.0




 


Rackspace

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