diff options
author | Paul E. McKenney <paul.mckenney@linaro.org> | 2012-12-30 00:51:20 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-03-26 11:04:54 -0400 |
commit | bd9f0686fc8c9a01c6850b1c611d1c9ad80b86d6 (patch) | |
tree | 9e19e1d9b746ee000864e42b50b49dbed89f946a /kernel/rcutree_plugin.h | |
parent | b92db6cb7efcbd41e469e1d757c47da4865f7622 (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>
Diffstat (limited to 'kernel/rcutree_plugin.h')
-rw-r--r-- | kernel/rcutree_plugin.h | 62 |
1 files changed, 32 insertions, 30 deletions
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 | ||