[PATCH] rcu: don't set ->next_pending in rcu_start_batch()

I think it is better to set ->next_pending in the caller, when
it is needed. This saves one parameter, and this coincides with
cpu_quiet() beahaviour, which sets ->completed = ->cur itself.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: Paul E. McKenney <paulmck@us.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Oleg Nesterov and committed by
Linus Torvalds
dbc1651f 1fd5a46d

+4 -7
+4 -7
kernel/rcupdate.c
··· 236 * active batch and the batch to be registered has not already occurred. 237 * Caller must hold rcu_state.lock. 238 */ 239 - static void rcu_start_batch(struct rcu_ctrlblk *rcp, struct rcu_state *rsp, 240 - int next_pending) 241 { 242 - if (next_pending) 243 - rcp->next_pending = 1; 244 - 245 if (rcp->next_pending && 246 rcp->completed == rcp->cur) { 247 rcp->next_pending = 0; ··· 271 if (cpus_empty(rsp->cpumask)) { 272 /* batch completed ! */ 273 rcp->completed = rcp->cur; 274 - rcu_start_batch(rcp, rsp, 0); 275 } 276 } 277 ··· 406 if (!rcp->next_pending) { 407 /* and start it/schedule start if it's a new batch */ 408 spin_lock(&rsp->lock); 409 - rcu_start_batch(rcp, rsp, 1); 410 spin_unlock(&rsp->lock); 411 } 412 } else {
··· 236 * active batch and the batch to be registered has not already occurred. 237 * Caller must hold rcu_state.lock. 238 */ 239 + static void rcu_start_batch(struct rcu_ctrlblk *rcp, struct rcu_state *rsp) 240 { 241 if (rcp->next_pending && 242 rcp->completed == rcp->cur) { 243 rcp->next_pending = 0; ··· 275 if (cpus_empty(rsp->cpumask)) { 276 /* batch completed ! */ 277 rcp->completed = rcp->cur; 278 + rcu_start_batch(rcp, rsp); 279 } 280 } 281 ··· 410 if (!rcp->next_pending) { 411 /* and start it/schedule start if it's a new batch */ 412 spin_lock(&rsp->lock); 413 + rcp->next_pending = 1; 414 + rcu_start_batch(rcp, rsp); 415 spin_unlock(&rsp->lock); 416 } 417 } else {