aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2006-03-24 06:15:50 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-24 10:33:20 -0500
commitcaa9ee771de3195ae85ac6f8cb550f53e9ecdd82 (patch)
tree8aa692f337e071718e698baefc631b58b446beff /kernel
parentcba9f33d13a8ca3125b2a30abe2425ce562d8a83 (diff)
[PATCH] rcu_process_callbacks: don't cli() while testing ->nxtlist
__rcu_process_callbacks() disables interrupts to protect itself from call_rcu() which adds new entries to ->nxtlist. However we can check "->nxtlist != NULL" with interrupts enabled, we can't get "false positives" because call_rcu() can only change this condition from 0 to 1. Tested with rcutorture.ko. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Acked-by: Dipankar Sarma <dipankar@in.ibm.com> Cc: "Paul E. McKenney" <paulmck@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rcupdate.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c
index 6df1559b1c02..13458bbaa1be 100644
--- a/kernel/rcupdate.c
+++ b/kernel/rcupdate.c
@@ -416,8 +416,8 @@ static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp,
416 rdp->curtail = &rdp->curlist; 416 rdp->curtail = &rdp->curlist;
417 } 417 }
418 418
419 local_irq_disable();
420 if (rdp->nxtlist && !rdp->curlist) { 419 if (rdp->nxtlist && !rdp->curlist) {
420 local_irq_disable();
421 rdp->curlist = rdp->nxtlist; 421 rdp->curlist = rdp->nxtlist;
422 rdp->curtail = rdp->nxttail; 422 rdp->curtail = rdp->nxttail;
423 rdp->nxtlist = NULL; 423 rdp->nxtlist = NULL;
@@ -442,9 +442,8 @@ static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp,
442 rcu_start_batch(rcp); 442 rcu_start_batch(rcp);
443 spin_unlock(&rcp->lock); 443 spin_unlock(&rcp->lock);
444 } 444 }
445 } else {
446 local_irq_enable();
447 } 445 }
446
448 rcu_check_quiescent_state(rcp, rdp); 447 rcu_check_quiescent_state(rcp, rdp);
449 if (rdp->donelist) 448 if (rdp->donelist)
450 rcu_do_batch(rdp); 449 rcu_do_batch(rdp);