aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2010-01-04 18:09:06 -0500
committerIngo Molnar <mingo@elte.hu>2010-01-13 03:06:03 -0500
commit0f10dc826646134dce3e5751512b87d30f3903e4 (patch)
tree6d377b3714889a0ab148166a33105b3be14be0c1 /kernel/rcutree.c
parenteb1ba45f1e7f6e626fefc063b340c7cbec9bd8c7 (diff)
rcu: Eliminate rcu_process_dyntick() return value
Because a new grace period cannot start while we are executing within the force_quiescent_state() function's switch statement, if any test within that switch statement or within any function called from that switch statement shows that the current grace period has ended, we can safely re-do that test any time before we leave the switch statement. This means that we no longer need a return value from rcu_process_dyntick(), as we can simply invoke rcu_gp_in_progress() to check whether the old grace period has finished -- there is no longer any need to worry about whether or not a new grace period has been started. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: laijs@cn.fujitsu.com Cc: dipankar@in.ibm.com Cc: mathieu.desnoyers@polymtl.ca Cc: josh@joshtriplett.org Cc: dvhltc@us.ibm.com Cc: niv@us.ibm.com Cc: peterz@infradead.org Cc: rostedt@goodmis.org Cc: Valdis.Kletnieks@vt.edu Cc: dhowells@redhat.com LKML-Reference: <12626465501857-git-send-email-> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/rcutree.c')
-rw-r--r--kernel/rcutree.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index c7d00700fc4e..e4971192fa9c 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -1144,11 +1144,9 @@ void rcu_check_callbacks(int cpu, int user)
1144/* 1144/*
1145 * Scan the leaf rcu_node structures, processing dyntick state for any that 1145 * Scan the leaf rcu_node structures, processing dyntick state for any that
1146 * have not yet encountered a quiescent state, using the function specified. 1146 * have not yet encountered a quiescent state, using the function specified.
1147 * Returns 1 if the current grace period ends while scanning (possibly
1148 * because we made it end).
1149 */ 1147 */
1150static int rcu_process_dyntick(struct rcu_state *rsp, 1148static void rcu_process_dyntick(struct rcu_state *rsp,
1151 int (*f)(struct rcu_data *)) 1149 int (*f)(struct rcu_data *))
1152{ 1150{
1153 unsigned long bit; 1151 unsigned long bit;
1154 int cpu; 1152 int cpu;
@@ -1161,7 +1159,7 @@ static int rcu_process_dyntick(struct rcu_state *rsp,
1161 spin_lock_irqsave(&rnp->lock, flags); 1159 spin_lock_irqsave(&rnp->lock, flags);
1162 if (rnp->completed != rsp->gpnum - 1) { 1160 if (rnp->completed != rsp->gpnum - 1) {
1163 spin_unlock_irqrestore(&rnp->lock, flags); 1161 spin_unlock_irqrestore(&rnp->lock, flags);
1164 return 1; 1162 return;
1165 } 1163 }
1166 if (rnp->qsmask == 0) { 1164 if (rnp->qsmask == 0) {
1167 spin_unlock_irqrestore(&rnp->lock, flags); 1165 spin_unlock_irqrestore(&rnp->lock, flags);
@@ -1181,7 +1179,6 @@ static int rcu_process_dyntick(struct rcu_state *rsp,
1181 } 1179 }
1182 spin_unlock_irqrestore(&rnp->lock, flags); 1180 spin_unlock_irqrestore(&rnp->lock, flags);
1183 } 1181 }
1184 return 0;
1185} 1182}
1186 1183
1187/* 1184/*
@@ -1193,7 +1190,6 @@ static void force_quiescent_state(struct rcu_state *rsp, int relaxed)
1193 unsigned long flags; 1190 unsigned long flags;
1194 struct rcu_node *rnp = rcu_get_root(rsp); 1191 struct rcu_node *rnp = rcu_get_root(rsp);
1195 u8 forcenow; 1192 u8 forcenow;
1196 u8 gpdone;
1197 1193
1198 if (!rcu_gp_in_progress(rsp)) 1194 if (!rcu_gp_in_progress(rsp))
1199 return; /* No grace period in progress, nothing to force. */ 1195 return; /* No grace period in progress, nothing to force. */
@@ -1226,10 +1222,9 @@ static void force_quiescent_state(struct rcu_state *rsp, int relaxed)
1226 break; /* So gcc recognizes the dead code. */ 1222 break; /* So gcc recognizes the dead code. */
1227 1223
1228 /* Record dyntick-idle state. */ 1224 /* Record dyntick-idle state. */
1229 gpdone = rcu_process_dyntick(rsp, 1225 rcu_process_dyntick(rsp, dyntick_save_progress_counter);
1230 dyntick_save_progress_counter);
1231 spin_lock(&rnp->lock); /* irqs already disabled */ 1226 spin_lock(&rnp->lock); /* irqs already disabled */
1232 if (gpdone) 1227 if (!rcu_gp_in_progress(rsp))
1233 break; 1228 break;
1234 /* fall into next case. */ 1229 /* fall into next case. */
1235 1230
@@ -1249,7 +1244,7 @@ static void force_quiescent_state(struct rcu_state *rsp, int relaxed)
1249 1244
1250 /* Check dyntick-idle state, send IPI to laggarts. */ 1245 /* Check dyntick-idle state, send IPI to laggarts. */
1251 spin_unlock(&rnp->lock); /* irqs remain disabled */ 1246 spin_unlock(&rnp->lock); /* irqs remain disabled */
1252 gpdone = rcu_process_dyntick(rsp, rcu_implicit_dynticks_qs); 1247 rcu_process_dyntick(rsp, rcu_implicit_dynticks_qs);
1253 1248
1254 /* Leave state in case more forcing is required. */ 1249 /* Leave state in case more forcing is required. */
1255 1250