aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2010-01-04 18:09:01 -0500
committerIngo Molnar <mingo@elte.hu>2010-01-13 03:06:01 -0500
commit559569acf94f538b56bd6eead80b439d6a78cdff (patch)
tree36ff850b4bfd45cdeb102092f4cf00c48ca86434 /kernel/rcutree.c
parentf96e9232e04856c781d4f71923a46dd3f7b429fa (diff)
rcu: Adjust force_quiescent_state() locking, step 2
This patch releases rnp->lock after the end of force_quiescent_state()'s switch statement. This is a second step towards prohibiting starting grace periods while force_quiescent_state() is executing, which will reduce the number and complexity of races that force_quiescent_state() is involved in. 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: <12626465501994-git-send-email-> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/rcutree.c')
-rw-r--r--kernel/rcutree.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index eae331da6be..d42ad30c4d7 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -1219,7 +1219,6 @@ static void force_quiescent_state(struct rcu_state *rsp, int relaxed)
1219 case RCU_GP_IDLE: 1219 case RCU_GP_IDLE:
1220 case RCU_GP_INIT: 1220 case RCU_GP_INIT:
1221 1221
1222 spin_unlock(&rnp->lock);
1223 break; /* grace period idle or initializing, ignore. */ 1222 break; /* grace period idle or initializing, ignore. */
1224 1223
1225 case RCU_SAVE_DYNTICK: 1224 case RCU_SAVE_DYNTICK:
@@ -1246,10 +1245,8 @@ static void force_quiescent_state(struct rcu_state *rsp, int relaxed)
1246 rsp->completed_fqs = lastcomp; 1245 rsp->completed_fqs = lastcomp;
1247 forcenow = signaled == RCU_SAVE_COMPLETED; 1246 forcenow = signaled == RCU_SAVE_COMPLETED;
1248 } 1247 }
1249 if (!forcenow) { 1248 if (!forcenow)
1250 spin_unlock(&rnp->lock);
1251 break; 1249 break;
1252 }
1253 /* fall into next case. */ 1250 /* fall into next case. */
1254 1251
1255 case RCU_FORCE_QS: 1252 case RCU_FORCE_QS:
@@ -1262,14 +1259,10 @@ static void force_quiescent_state(struct rcu_state *rsp, int relaxed)
1262 1259
1263 /* Leave state in case more forcing is required. */ 1260 /* Leave state in case more forcing is required. */
1264 1261
1265 break; 1262 spin_lock(&rnp->lock);
1266
1267 default:
1268
1269 spin_unlock(&rnp->lock);
1270 WARN_ON_ONCE(1);
1271 break; 1263 break;
1272 } 1264 }
1265 spin_unlock(&rnp->lock);
1273unlock_fqs_ret: 1266unlock_fqs_ret:
1274 spin_unlock_irqrestore(&rsp->fqslock, flags); 1267 spin_unlock_irqrestore(&rsp->fqslock, flags);
1275} 1268}