aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul E. McKenney <paul.mckenney@linaro.org>2012-12-30 00:51:20 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2013-03-26 11:04:54 -0400
commitbd9f0686fc8c9a01c6850b1c611d1c9ad80b86d6 (patch)
tree9e19e1d9b746ee000864e42b50b49dbed89f946a
parentb92db6cb7efcbd41e469e1d757c47da4865f7622 (diff)
rcu: Repurpose no-CBs event tracing to future-GP events
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.mckenney@linaro.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rw-r--r--include/trace/events/rcu.h16
-rw-r--r--kernel/rcutree_plugin.h62
2 files changed, 40 insertions, 38 deletions
diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h
index cdfed6d386eb..59ebcc89f148 100644
--- a/include/trace/events/rcu.h
+++ b/include/trace/events/rcu.h
@@ -72,10 +72,10 @@ TRACE_EVENT(rcu_grace_period,
72); 72);
73 73
74/* 74/*
75 * Tracepoint for no-callbacks grace-period events. The caller should 75 * Tracepoint for future grace-period events, including those for no-callbacks
76 * pull the data from the rcu_node structure, other than rcuname, which 76 * CPUs. The caller should pull the data from the rcu_node structure,
77 * comes from the rcu_state structure, and event, which is one of the 77 * other than rcuname, which comes from the rcu_state structure, and event,
78 * following: 78 * which is one of the following:
79 * 79 *
80 * "Startleaf": Request a nocb grace period based on leaf-node data. 80 * "Startleaf": Request a nocb grace period based on leaf-node data.
81 * "Startedleaf": Leaf-node start proved sufficient. 81 * "Startedleaf": Leaf-node start proved sufficient.
@@ -87,7 +87,7 @@ TRACE_EVENT(rcu_grace_period,
87 * "Cleanup": Clean up rcu_node structure after previous GP. 87 * "Cleanup": Clean up rcu_node structure after previous GP.
88 * "CleanupMore": Clean up, and another no-CB GP is needed. 88 * "CleanupMore": Clean up, and another no-CB GP is needed.
89 */ 89 */
90TRACE_EVENT(rcu_nocb_grace_period, 90TRACE_EVENT(rcu_future_grace_period,
91 91
92 TP_PROTO(char *rcuname, unsigned long gpnum, unsigned long completed, 92 TP_PROTO(char *rcuname, unsigned long gpnum, unsigned long completed,
93 unsigned long c, u8 level, int grplo, int grphi, 93 unsigned long c, u8 level, int grplo, int grphi,
@@ -653,9 +653,9 @@ TRACE_EVENT(rcu_barrier,
653#define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0) 653#define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0)
654#define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \ 654#define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \
655 qsmask) do { } while (0) 655 qsmask) do { } while (0)
656#define trace_rcu_nocb_grace_period(rcuname, gpnum, completed, c, \ 656#define trace_rcu_future_grace_period(rcuname, gpnum, completed, c, \
657 level, grplo, grphi, event) \ 657 level, grplo, grphi, event) \
658 do { } while (0) 658 do { } while (0)
659#define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0) 659#define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0)
660#define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0) 660#define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0)
661#define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \ 661#define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
index d318f9f18be5..df50502eca2c 100644
--- a/kernel/rcutree_plugin.h
+++ b/kernel/rcutree_plugin.h
@@ -2034,9 +2034,9 @@ static int rcu_nocb_gp_cleanup(struct rcu_state *rsp, struct rcu_node *rnp)
2034 wake_up_all(&rnp->nocb_gp_wq[c & 0x1]); 2034 wake_up_all(&rnp->nocb_gp_wq[c & 0x1]);
2035 rnp->n_nocb_gp_requests[c & 0x1] = 0; 2035 rnp->n_nocb_gp_requests[c & 0x1] = 0;
2036 needmore = rnp->n_nocb_gp_requests[(c + 1) & 0x1]; 2036 needmore = rnp->n_nocb_gp_requests[(c + 1) & 0x1];
2037 trace_rcu_nocb_grace_period(rsp->name, rnp->gpnum, rnp->completed, 2037 trace_rcu_future_grace_period(rsp->name, rnp->gpnum, rnp->completed,
2038 c, rnp->level, rnp->grplo, rnp->grphi, 2038 c, rnp->level, rnp->grplo, rnp->grphi,
2039 needmore ? "CleanupMore" : "Cleanup"); 2039 needmore ? "CleanupMore" : "Cleanup");
2040 return needmore; 2040 return needmore;
2041} 2041}
2042 2042
@@ -2183,9 +2183,9 @@ static void rcu_nocb_wait_gp(struct rcu_data *rdp)
2183 2183
2184 /* Count our request for a grace period. */ 2184 /* Count our request for a grace period. */
2185 rnp->n_nocb_gp_requests[c & 0x1]++; 2185 rnp->n_nocb_gp_requests[c & 0x1]++;
2186 trace_rcu_nocb_grace_period(rdp->rsp->name, rnp->gpnum, rnp->completed, 2186 trace_rcu_future_grace_period(rdp->rsp->name, rnp->gpnum,
2187 c, rnp->level, rnp->grplo, rnp->grphi, 2187 rnp->completed, c, rnp->level,
2188 "Startleaf"); 2188 rnp->grplo, rnp->grphi, "Startleaf");
2189 2189
2190 if (rnp->gpnum != rnp->completed) { 2190 if (rnp->gpnum != rnp->completed) {
2191 2191
@@ -2194,10 +2194,10 @@ static void rcu_nocb_wait_gp(struct rcu_data *rdp)
2194 * is in progress, so we are done. When this grace 2194 * is in progress, so we are done. When this grace
2195 * period ends, our request will be acted upon. 2195 * period ends, our request will be acted upon.
2196 */ 2196 */
2197 trace_rcu_nocb_grace_period(rdp->rsp->name, 2197 trace_rcu_future_grace_period(rdp->rsp->name, rnp->gpnum,
2198 rnp->gpnum, rnp->completed, c, 2198 rnp->completed, c, rnp->level,
2199 rnp->level, rnp->grplo, rnp->grphi, 2199 rnp->grplo, rnp->grphi,
2200 "Startedleaf"); 2200 "Startedleaf");
2201 raw_spin_unlock_irqrestore(&rnp->lock, flags); 2201 raw_spin_unlock_irqrestore(&rnp->lock, flags);
2202 2202
2203 } else { 2203 } else {
@@ -2209,11 +2209,12 @@ static void rcu_nocb_wait_gp(struct rcu_data *rdp)
2209 if (rnp != rnp_root) 2209 if (rnp != rnp_root)
2210 raw_spin_lock(&rnp_root->lock); /* irqs disabled. */ 2210 raw_spin_lock(&rnp_root->lock); /* irqs disabled. */
2211 if (rnp_root->gpnum != rnp_root->completed) { 2211 if (rnp_root->gpnum != rnp_root->completed) {
2212 trace_rcu_nocb_grace_period(rdp->rsp->name, 2212 trace_rcu_future_grace_period(rdp->rsp->name,
2213 rnp->gpnum, rnp->completed, 2213 rnp->gpnum,
2214 c, rnp->level, 2214 rnp->completed,
2215 rnp->grplo, rnp->grphi, 2215 c, rnp->level,
2216 "Startedleafroot"); 2216 rnp->grplo, rnp->grphi,
2217 "Startedleafroot");
2217 raw_spin_unlock(&rnp_root->lock); /* irqs disabled. */ 2218 raw_spin_unlock(&rnp_root->lock); /* irqs disabled. */
2218 } else { 2219 } else {
2219 2220
@@ -2229,11 +2230,12 @@ static void rcu_nocb_wait_gp(struct rcu_data *rdp)
2229 c = rnp_root->completed + 1; 2230 c = rnp_root->completed + 1;
2230 rnp->n_nocb_gp_requests[c & 0x1]++; 2231 rnp->n_nocb_gp_requests[c & 0x1]++;
2231 rnp_root->n_nocb_gp_requests[c & 0x1]++; 2232 rnp_root->n_nocb_gp_requests[c & 0x1]++;
2232 trace_rcu_nocb_grace_period(rdp->rsp->name, 2233 trace_rcu_future_grace_period(rdp->rsp->name,
2233 rnp->gpnum, rnp->completed, 2234 rnp->gpnum,
2234 c, rnp->level, 2235 rnp->completed,
2235 rnp->grplo, rnp->grphi, 2236 c, rnp->level,
2236 "Startedroot"); 2237 rnp->grplo, rnp->grphi,
2238 "Startedroot");
2237 local_save_flags(flags1); 2239 local_save_flags(flags1);
2238 rcu_start_gp(rdp->rsp, flags1); /* Rlses ->lock. */ 2240 rcu_start_gp(rdp->rsp, flags1); /* Rlses ->lock. */
2239 } 2241 }
@@ -2249,9 +2251,9 @@ static void rcu_nocb_wait_gp(struct rcu_data *rdp)
2249 * Wait for the grace period. Do so interruptibly to avoid messing 2251 * Wait for the grace period. Do so interruptibly to avoid messing
2250 * up the load average. 2252 * up the load average.
2251 */ 2253 */
2252 trace_rcu_nocb_grace_period(rdp->rsp->name, rnp->gpnum, rnp->completed, 2254 trace_rcu_future_grace_period(rdp->rsp->name, rnp->gpnum,
2253 c, rnp->level, rnp->grplo, rnp->grphi, 2255 rnp->completed, c, rnp->level,
2254 "StartWait"); 2256 rnp->grplo, rnp->grphi, "StartWait");
2255 for (;;) { 2257 for (;;) {
2256 wait_event_interruptible( 2258 wait_event_interruptible(
2257 rnp->nocb_gp_wq[c & 0x1], 2259 rnp->nocb_gp_wq[c & 0x1],
@@ -2259,14 +2261,14 @@ static void rcu_nocb_wait_gp(struct rcu_data *rdp)
2259 if (likely(d)) 2261 if (likely(d))
2260 break; 2262 break;
2261 flush_signals(current); 2263 flush_signals(current);
2262 trace_rcu_nocb_grace_period(rdp->rsp->name, 2264 trace_rcu_future_grace_period(rdp->rsp->name,
2263 rnp->gpnum, rnp->completed, c, 2265 rnp->gpnum, rnp->completed, c,
2264 rnp->level, rnp->grplo, rnp->grphi, 2266 rnp->level, rnp->grplo,
2265 "ResumeWait"); 2267 rnp->grphi, "ResumeWait");
2266 } 2268 }
2267 trace_rcu_nocb_grace_period(rdp->rsp->name, rnp->gpnum, rnp->completed, 2269 trace_rcu_future_grace_period(rdp->rsp->name, rnp->gpnum,
2268 c, rnp->level, rnp->grplo, rnp->grphi, 2270 rnp->completed, c, rnp->level,
2269 "EndWait"); 2271 rnp->grplo, rnp->grphi, "EndWait");
2270 smp_mb(); /* Ensure that CB invocation happens after GP end. */ 2272 smp_mb(); /* Ensure that CB invocation happens after GP end. */
2271} 2273}
2272 2274