Commit 0f10dc82 authored by Paul E. McKenney's avatar Paul E. McKenney Committed by Ingo Molnar

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: default avatarPaul 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: default avatarIngo Molnar <mingo@elte.hu>
parent eb1ba45f
...@@ -1144,11 +1144,9 @@ void rcu_check_callbacks(int cpu, int user) ...@@ -1144,11 +1144,9 @@ void rcu_check_callbacks(int cpu, int user)
/* /*
* Scan the leaf rcu_node structures, processing dyntick state for any that * Scan the leaf rcu_node structures, processing dyntick state for any that
* have not yet encountered a quiescent state, using the function specified. * have not yet encountered a quiescent state, using the function specified.
* Returns 1 if the current grace period ends while scanning (possibly
* because we made it end).
*/ */
static int rcu_process_dyntick(struct rcu_state *rsp, static void rcu_process_dyntick(struct rcu_state *rsp,
int (*f)(struct rcu_data *)) int (*f)(struct rcu_data *))
{ {
unsigned long bit; unsigned long bit;
int cpu; int cpu;
...@@ -1161,7 +1159,7 @@ static int rcu_process_dyntick(struct rcu_state *rsp, ...@@ -1161,7 +1159,7 @@ static int rcu_process_dyntick(struct rcu_state *rsp,
spin_lock_irqsave(&rnp->lock, flags); spin_lock_irqsave(&rnp->lock, flags);
if (rnp->completed != rsp->gpnum - 1) { if (rnp->completed != rsp->gpnum - 1) {
spin_unlock_irqrestore(&rnp->lock, flags); spin_unlock_irqrestore(&rnp->lock, flags);
return 1; return;
} }
if (rnp->qsmask == 0) { if (rnp->qsmask == 0) {
spin_unlock_irqrestore(&rnp->lock, flags); spin_unlock_irqrestore(&rnp->lock, flags);
...@@ -1181,7 +1179,6 @@ static int rcu_process_dyntick(struct rcu_state *rsp, ...@@ -1181,7 +1179,6 @@ static int rcu_process_dyntick(struct rcu_state *rsp,
} }
spin_unlock_irqrestore(&rnp->lock, flags); spin_unlock_irqrestore(&rnp->lock, flags);
} }
return 0;
} }
/* /*
...@@ -1193,7 +1190,6 @@ static void force_quiescent_state(struct rcu_state *rsp, int relaxed) ...@@ -1193,7 +1190,6 @@ static void force_quiescent_state(struct rcu_state *rsp, int relaxed)
unsigned long flags; unsigned long flags;
struct rcu_node *rnp = rcu_get_root(rsp); struct rcu_node *rnp = rcu_get_root(rsp);
u8 forcenow; u8 forcenow;
u8 gpdone;
if (!rcu_gp_in_progress(rsp)) if (!rcu_gp_in_progress(rsp))
return; /* No grace period in progress, nothing to force. */ 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,10 +1222,9 @@ static void force_quiescent_state(struct rcu_state *rsp, int relaxed)
break; /* So gcc recognizes the dead code. */ break; /* So gcc recognizes the dead code. */
/* Record dyntick-idle state. */ /* Record dyntick-idle state. */
gpdone = rcu_process_dyntick(rsp, rcu_process_dyntick(rsp, dyntick_save_progress_counter);
dyntick_save_progress_counter);
spin_lock(&rnp->lock); /* irqs already disabled */ spin_lock(&rnp->lock); /* irqs already disabled */
if (gpdone) if (!rcu_gp_in_progress(rsp))
break; break;
/* fall into next case. */ /* fall into next case. */
...@@ -1249,7 +1244,7 @@ static void force_quiescent_state(struct rcu_state *rsp, int relaxed) ...@@ -1249,7 +1244,7 @@ static void force_quiescent_state(struct rcu_state *rsp, int relaxed)
/* Check dyntick-idle state, send IPI to laggarts. */ /* Check dyntick-idle state, send IPI to laggarts. */
spin_unlock(&rnp->lock); /* irqs remain disabled */ spin_unlock(&rnp->lock); /* irqs remain disabled */
gpdone = rcu_process_dyntick(rsp, rcu_implicit_dynticks_qs); rcu_process_dyntick(rsp, rcu_implicit_dynticks_qs);
/* Leave state in case more forcing is required. */ /* Leave state in case more forcing is required. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment