From: Oleg Nesterov Date: Fri, 24 Mar 2006 11:15:50 +0000 (-0800) Subject: [PATCH] rcu_process_callbacks: don't cli() while testing ->nxtlist X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=caa9ee771de3195ae85ac6f8cb550f53e9ecdd82;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git [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 Acked-by: Dipankar Sarma Cc: "Paul E. McKenney" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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, rdp->curtail = &rdp->curlist; } - local_irq_disable(); if (rdp->nxtlist && !rdp->curlist) { + local_irq_disable(); rdp->curlist = rdp->nxtlist; rdp->curtail = rdp->nxttail; rdp->nxtlist = NULL; @@ -442,9 +442,8 @@ static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp, rcu_start_batch(rcp); spin_unlock(&rcp->lock); } - } else { - local_irq_enable(); } + rcu_check_quiescent_state(rcp, rdp); if (rdp->donelist) rcu_do_batch(rdp);