Commit 0f10dc826646134dce3e5751512b87d30f3903e4

Authored by Paul E. McKenney
Committed by Ingo Molnar
1 parent eb1ba45f1e

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>

Showing 1 changed file with 6 additions and 11 deletions Side-by-side Diff

... ... @@ -1144,11 +1144,9 @@
1144 1144 /*
1145 1145 * Scan the leaf rcu_node structures, processing dyntick state for any that
1146 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 */
1150   -static int rcu_process_dyntick(struct rcu_state *rsp,
1151   - int (*f)(struct rcu_data *))
  1148 +static void rcu_process_dyntick(struct rcu_state *rsp,
  1149 + int (*f)(struct rcu_data *))
1152 1150 {
1153 1151 unsigned long bit;
1154 1152 int cpu;
... ... @@ -1161,7 +1159,7 @@
1161 1159 spin_lock_irqsave(&rnp->lock, flags);
1162 1160 if (rnp->completed != rsp->gpnum - 1) {
1163 1161 spin_unlock_irqrestore(&rnp->lock, flags);
1164   - return 1;
  1162 + return;
1165 1163 }
1166 1164 if (rnp->qsmask == 0) {
1167 1165 spin_unlock_irqrestore(&rnp->lock, flags);
... ... @@ -1181,7 +1179,6 @@
1181 1179 }
1182 1180 spin_unlock_irqrestore(&rnp->lock, flags);
1183 1181 }
1184   - return 0;
1185 1182 }
1186 1183  
1187 1184 /*
... ... @@ -1193,7 +1190,6 @@
1193 1190 unsigned long flags;
1194 1191 struct rcu_node *rnp = rcu_get_root(rsp);
1195 1192 u8 forcenow;
1196   - u8 gpdone;
1197 1193  
1198 1194 if (!rcu_gp_in_progress(rsp))
1199 1195 return; /* No grace period in progress, nothing to force. */
1200 1196  
... ... @@ -1226,10 +1222,9 @@
1226 1222 break; /* So gcc recognizes the dead code. */
1227 1223  
1228 1224 /* Record dyntick-idle state. */
1229   - gpdone = rcu_process_dyntick(rsp,
1230   - dyntick_save_progress_counter);
  1225 + rcu_process_dyntick(rsp, dyntick_save_progress_counter);
1231 1226 spin_lock(&rnp->lock); /* irqs already disabled */
1232   - if (gpdone)
  1227 + if (!rcu_gp_in_progress(rsp))
1233 1228 break;
1234 1229 /* fall into next case. */
1235 1230  
... ... @@ -1249,7 +1244,7 @@
1249 1244  
1250 1245 /* Check dyntick-idle state, send IPI to laggarts. */
1251 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 1249 /* Leave state in case more forcing is required. */
1255 1250