[PATCH tip/core/rcu 08/12] rcu: Repurpose no-CBs event tracing to future-GP events

2013-01-26 Thread Paul E. McKenney
From: "Paul E. McKenney" 

Dyntick-idle CPUs need to be able to pre-announce their need for grace
periods.  This can be done using something similar to the mechanism used
by no-CB CPUs to announce their need for grace periods.  This commit
moves in this direction by renaming the no-CBs grace-period event tracing
to suit the new future-grace-period needs.

Signed-off-by: Paul E. McKenney 
Signed-off-by: Paul E. McKenney 
---
 include/trace/events/rcu.h |   16 +-
 kernel/rcutree_plugin.h|   62 ++-
 2 files changed, 40 insertions(+), 38 deletions(-)

diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h
index cdfed6d..59ebcc8 100644
--- a/include/trace/events/rcu.h
+++ b/include/trace/events/rcu.h
@@ -72,10 +72,10 @@ TRACE_EVENT(rcu_grace_period,
 );
 
 /*
- * Tracepoint for no-callbacks grace-period events.  The caller should
- * pull the data from the rcu_node structure, other than rcuname, which
- * comes from the rcu_state structure, and event, which is one of the
- * following:
+ * Tracepoint for future grace-period events, including those for no-callbacks
+ * CPUs.  The caller should pull the data from the rcu_node structure,
+ * other than rcuname, which comes from the rcu_state structure, and event,
+ * which is one of the following:
  *
  * "Startleaf": Request a nocb grace period based on leaf-node data.
  * "Startedleaf": Leaf-node start proved sufficient.
@@ -87,7 +87,7 @@ TRACE_EVENT(rcu_grace_period,
  * "Cleanup": Clean up rcu_node structure after previous GP.
  * "CleanupMore": Clean up, and another no-CB GP is needed.
  */
-TRACE_EVENT(rcu_nocb_grace_period,
+TRACE_EVENT(rcu_future_grace_period,
 
TP_PROTO(char *rcuname, unsigned long gpnum, unsigned long completed,
 unsigned long c, u8 level, int grplo, int grphi,
@@ -653,9 +653,9 @@ TRACE_EVENT(rcu_barrier,
 #define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0)
 #define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \
qsmask) do { } while (0)
-#define trace_rcu_nocb_grace_period(rcuname, gpnum, completed, c, \
-   level, grplo, grphi, event) \
-   do { } while (0)
+#define trace_rcu_future_grace_period(rcuname, gpnum, completed, c, \
+ level, grplo, grphi, event) \
+ do { } while (0)
 #define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0)
 #define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0)
 #define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
index d55475b..bcd8268 100644
--- a/kernel/rcutree_plugin.h
+++ b/kernel/rcutree_plugin.h
@@ -2080,9 +2080,9 @@ static int rcu_nocb_gp_cleanup(struct rcu_state *rsp, 
struct rcu_node *rnp)
wake_up_all(>nocb_gp_wq[c & 0x1]);
rnp->n_nocb_gp_requests[c & 0x1] = 0;
needmore = rnp->n_nocb_gp_requests[(c + 1) & 0x1];
-   trace_rcu_nocb_grace_period(rsp->name, rnp->gpnum, rnp->completed,
-   c, rnp->level, rnp->grplo, rnp->grphi,
-   needmore ? "CleanupMore" : "Cleanup");
+   trace_rcu_future_grace_period(rsp->name, rnp->gpnum, rnp->completed,
+ c, rnp->level, rnp->grplo, rnp->grphi,
+ needmore ? "CleanupMore" : "Cleanup");
return needmore;
 }
 
@@ -2229,9 +2229,9 @@ static void rcu_nocb_wait_gp(struct rcu_data *rdp)
 
/* Count our request for a grace period. */
rnp->n_nocb_gp_requests[c & 0x1]++;
-   trace_rcu_nocb_grace_period(rdp->rsp->name, rnp->gpnum, rnp->completed,
-   c, rnp->level, rnp->grplo, rnp->grphi,
-   "Startleaf");
+   trace_rcu_future_grace_period(rdp->rsp->name, rnp->gpnum,
+ rnp->completed, c, rnp->level,
+ rnp->grplo, rnp->grphi, "Startleaf");
 
if (rnp->gpnum != rnp->completed) {
 
@@ -2240,10 +2240,10 @@ static void rcu_nocb_wait_gp(struct rcu_data *rdp)
 * is in progress, so we are done.  When this grace
 * period ends, our request will be acted upon.
 */
-   trace_rcu_nocb_grace_period(rdp->rsp->name,
-   rnp->gpnum, rnp->completed, c,
-   rnp->level, rnp->grplo, rnp->grphi,
-   "Startedleaf");
+   trace_rcu_future_grace_period(rdp->rsp->name, rnp->gpnum,
+ rnp->completed, c, rnp->level,
+ rnp->grplo, rnp->grphi,
+

[PATCH tip/core/rcu 08/12] rcu: Repurpose no-CBs event tracing to future-GP events

2013-01-26 Thread Paul E. McKenney
From: Paul E. McKenney paul.mcken...@linaro.org

Dyntick-idle CPUs need to be able to pre-announce their need for grace
periods.  This can be done using something similar to the mechanism used
by no-CB CPUs to announce their need for grace periods.  This commit
moves in this direction by renaming the no-CBs grace-period event tracing
to suit the new future-grace-period needs.

Signed-off-by: Paul E. McKenney paul.mcken...@linaro.org
Signed-off-by: Paul E. McKenney paul...@linux.vnet.ibm.com
---
 include/trace/events/rcu.h |   16 +-
 kernel/rcutree_plugin.h|   62 ++-
 2 files changed, 40 insertions(+), 38 deletions(-)

diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h
index cdfed6d..59ebcc8 100644
--- a/include/trace/events/rcu.h
+++ b/include/trace/events/rcu.h
@@ -72,10 +72,10 @@ TRACE_EVENT(rcu_grace_period,
 );
 
 /*
- * Tracepoint for no-callbacks grace-period events.  The caller should
- * pull the data from the rcu_node structure, other than rcuname, which
- * comes from the rcu_state structure, and event, which is one of the
- * following:
+ * Tracepoint for future grace-period events, including those for no-callbacks
+ * CPUs.  The caller should pull the data from the rcu_node structure,
+ * other than rcuname, which comes from the rcu_state structure, and event,
+ * which is one of the following:
  *
  * Startleaf: Request a nocb grace period based on leaf-node data.
  * Startedleaf: Leaf-node start proved sufficient.
@@ -87,7 +87,7 @@ TRACE_EVENT(rcu_grace_period,
  * Cleanup: Clean up rcu_node structure after previous GP.
  * CleanupMore: Clean up, and another no-CB GP is needed.
  */
-TRACE_EVENT(rcu_nocb_grace_period,
+TRACE_EVENT(rcu_future_grace_period,
 
TP_PROTO(char *rcuname, unsigned long gpnum, unsigned long completed,
 unsigned long c, u8 level, int grplo, int grphi,
@@ -653,9 +653,9 @@ TRACE_EVENT(rcu_barrier,
 #define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0)
 #define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \
qsmask) do { } while (0)
-#define trace_rcu_nocb_grace_period(rcuname, gpnum, completed, c, \
-   level, grplo, grphi, event) \
-   do { } while (0)
+#define trace_rcu_future_grace_period(rcuname, gpnum, completed, c, \
+ level, grplo, grphi, event) \
+ do { } while (0)
 #define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0)
 #define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0)
 #define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
index d55475b..bcd8268 100644
--- a/kernel/rcutree_plugin.h
+++ b/kernel/rcutree_plugin.h
@@ -2080,9 +2080,9 @@ static int rcu_nocb_gp_cleanup(struct rcu_state *rsp, 
struct rcu_node *rnp)
wake_up_all(rnp-nocb_gp_wq[c  0x1]);
rnp-n_nocb_gp_requests[c  0x1] = 0;
needmore = rnp-n_nocb_gp_requests[(c + 1)  0x1];
-   trace_rcu_nocb_grace_period(rsp-name, rnp-gpnum, rnp-completed,
-   c, rnp-level, rnp-grplo, rnp-grphi,
-   needmore ? CleanupMore : Cleanup);
+   trace_rcu_future_grace_period(rsp-name, rnp-gpnum, rnp-completed,
+ c, rnp-level, rnp-grplo, rnp-grphi,
+ needmore ? CleanupMore : Cleanup);
return needmore;
 }
 
@@ -2229,9 +2229,9 @@ static void rcu_nocb_wait_gp(struct rcu_data *rdp)
 
/* Count our request for a grace period. */
rnp-n_nocb_gp_requests[c  0x1]++;
-   trace_rcu_nocb_grace_period(rdp-rsp-name, rnp-gpnum, rnp-completed,
-   c, rnp-level, rnp-grplo, rnp-grphi,
-   Startleaf);
+   trace_rcu_future_grace_period(rdp-rsp-name, rnp-gpnum,
+ rnp-completed, c, rnp-level,
+ rnp-grplo, rnp-grphi, Startleaf);
 
if (rnp-gpnum != rnp-completed) {
 
@@ -2240,10 +2240,10 @@ static void rcu_nocb_wait_gp(struct rcu_data *rdp)
 * is in progress, so we are done.  When this grace
 * period ends, our request will be acted upon.
 */
-   trace_rcu_nocb_grace_period(rdp-rsp-name,
-   rnp-gpnum, rnp-completed, c,
-   rnp-level, rnp-grplo, rnp-grphi,
-   Startedleaf);
+   trace_rcu_future_grace_period(rdp-rsp-name, rnp-gpnum,
+ rnp-completed, c, rnp-level,
+ rnp-grplo, rnp-grphi,
+