aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree_plugin.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paul.mckenney@linaro.org>2012-12-30 16:06:35 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2013-03-26 11:04:56 -0400
commit8b425aa8f1acfe48aed919c7aadff2ed290fe969 (patch)
tree355c435f747bda4c4051bf2a0e4f88596d7055e2 /kernel/rcutree_plugin.h
parentb8462084a2a88a6a0489f9bb7d8b1bb95bc455ab (diff)
rcu: Rename n_nocb_gp_requests to need_future_gp
CPUs going idle need to be able to indicate their need for future grace periods. A mechanism for doing this already exists for no-callbacks CPUs, so the idea is to re-use that mechanism. This commit therefore moves the ->n_nocb_gp_requests field of the rcu_node structure out from under the CONFIG_RCU_NOCB_CPU #ifdef and renames it to ->need_future_gp. 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.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
index 073ded26e259..f3f0020b5b58 100644
--- a/kernel/rcutree_plugin.h
+++ b/kernel/rcutree_plugin.h
@@ -2018,7 +2018,7 @@ static int rcu_nocb_needs_gp(struct rcu_state *rsp)
2018{ 2018{
2019 struct rcu_node *rnp = rcu_get_root(rsp); 2019 struct rcu_node *rnp = rcu_get_root(rsp);
2020 2020
2021 return rnp->n_nocb_gp_requests[(ACCESS_ONCE(rnp->completed) + 1) & 0x1]; 2021 return rnp->need_future_gp[(ACCESS_ONCE(rnp->completed) + 1) & 0x1];
2022} 2022}
2023 2023
2024/* 2024/*
@@ -2032,8 +2032,8 @@ static int rcu_nocb_gp_cleanup(struct rcu_state *rsp, struct rcu_node *rnp)
2032 int needmore; 2032 int needmore;
2033 2033
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->need_future_gp[c & 0x1] = 0;
2036 needmore = rnp->n_nocb_gp_requests[(c + 1) & 0x1]; 2036 needmore = rnp->need_future_gp[(c + 1) & 0x1];
2037 trace_rcu_future_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");
@@ -2041,7 +2041,7 @@ static int rcu_nocb_gp_cleanup(struct rcu_state *rsp, struct rcu_node *rnp)
2041} 2041}
2042 2042
2043/* 2043/*
2044 * Set the root rcu_node structure's ->n_nocb_gp_requests field 2044 * Set the root rcu_node structure's ->need_future_gp field
2045 * based on the sum of those of all rcu_node structures. This does 2045 * based on the sum of those of all rcu_node structures. This does
2046 * double-count the root rcu_node structure's requests, but this 2046 * double-count the root rcu_node structure's requests, but this
2047 * is necessary to handle the possibility of a rcu_nocb_kthread() 2047 * is necessary to handle the possibility of a rcu_nocb_kthread()
@@ -2050,7 +2050,7 @@ static int rcu_nocb_gp_cleanup(struct rcu_state *rsp, struct rcu_node *rnp)
2050 */ 2050 */
2051static void rcu_nocb_gp_set(struct rcu_node *rnp, int nrq) 2051static void rcu_nocb_gp_set(struct rcu_node *rnp, int nrq)
2052{ 2052{
2053 rnp->n_nocb_gp_requests[(rnp->completed + 1) & 0x1] += nrq; 2053 rnp->need_future_gp[(rnp->completed + 1) & 0x1] += nrq;
2054} 2054}
2055 2055
2056static void rcu_init_one_nocb(struct rcu_node *rnp) 2056static void rcu_init_one_nocb(struct rcu_node *rnp)
@@ -2181,7 +2181,7 @@ static void rcu_nocb_wait_gp(struct rcu_data *rdp)
2181 c = rnp->completed + 2; 2181 c = rnp->completed + 2;
2182 2182
2183 /* Count our request for a grace period. */ 2183 /* Count our request for a grace period. */
2184 rnp->n_nocb_gp_requests[c & 0x1]++; 2184 rnp->need_future_gp[c & 0x1]++;
2185 trace_rcu_future_grace_period(rdp->rsp->name, rnp->gpnum, 2185 trace_rcu_future_grace_period(rdp->rsp->name, rnp->gpnum,
2186 rnp->completed, c, rnp->level, 2186 rnp->completed, c, rnp->level,
2187 rnp->grplo, rnp->grphi, "Startleaf"); 2187 rnp->grplo, rnp->grphi, "Startleaf");
@@ -2225,10 +2225,10 @@ static void rcu_nocb_wait_gp(struct rcu_data *rdp)
2225 * Adjust counters accordingly and start the 2225 * Adjust counters accordingly and start the
2226 * needed grace period. 2226 * needed grace period.
2227 */ 2227 */
2228 rnp->n_nocb_gp_requests[c & 0x1]--; 2228 rnp->need_future_gp[c & 0x1]--;
2229 c = rnp_root->completed + 1; 2229 c = rnp_root->completed + 1;
2230 rnp->n_nocb_gp_requests[c & 0x1]++; 2230 rnp->need_future_gp[c & 0x1]++;
2231 rnp_root->n_nocb_gp_requests[c & 0x1]++; 2231 rnp_root->need_future_gp[c & 0x1]++;
2232 trace_rcu_future_grace_period(rdp->rsp->name, 2232 trace_rcu_future_grace_period(rdp->rsp->name,
2233 rnp->gpnum, 2233 rnp->gpnum,
2234 rnp->completed, 2234 rnp->completed,