aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2006-01-08 22:19:33 +0300
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-09 17:01:39 -0800
commitdbc1651f0c5b7d13acc59d3b805a7224332fb1fb (patch)
tree1e380afb42aa091d2acce50cd2cc10e368d1026a /kernel
parent1fd5a46dd6bbca3a1275465120caf4748872c2a7 (diff)
[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>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rcupdate.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c
index ccc45d49ce7..05ee48316f7 100644
--- a/kernel/rcupdate.c
+++ b/kernel/rcupdate.c
@@ -236,12 +236,8 @@ static void rcu_do_batch(struct rcu_data *rdp)
* active batch and the batch to be registered has not already occurred.
* Caller must hold rcu_state.lock.
*/
-static void rcu_start_batch(struct rcu_ctrlblk *rcp, struct rcu_state *rsp,
- int next_pending)
+static void rcu_start_batch(struct rcu_ctrlblk *rcp, struct rcu_state *rsp)
{
- if (next_pending)
- rcp->next_pending = 1;
-
if (rcp->next_pending &&
rcp->completed == rcp->cur) {
rcp->next_pending = 0;
@@ -275,7 +271,7 @@ static void cpu_quiet(int cpu, struct rcu_ctrlblk *rcp, struct rcu_state *rsp)
if (cpus_empty(rsp->cpumask)) {
/* batch completed ! */
rcp->completed = rcp->cur;
- rcu_start_batch(rcp, rsp, 0);
+ rcu_start_batch(rcp, rsp);
}
}
@@ -410,7 +406,8 @@ static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp,
if (!rcp->next_pending) {
/* and start it/schedule start if it's a new batch */
spin_lock(&rsp->lock);
- rcu_start_batch(rcp, rsp, 1);
+ rcp->next_pending = 1;
+ rcu_start_batch(rcp, rsp);
spin_unlock(&rsp->lock);
}
} else {