[PATCH] rcu_process_callbacks: don't cli() while testing ->nxtlist

From: Oleg Nesterov
Date: Sat Jan 28 2006 - 12:43:17 EST


__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@xxxxxxxxxx>

--- RC-1/kernel/rcupdate.c~ 2006-01-19 18:13:07.000000000 +0300
+++ RC-1/kernel/rcupdate.c 2006-01-29 00:13:24.000000000 +0300
@@ -381,8 +381,8 @@ static void __rcu_process_callbacks(stru
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;
@@ -407,9 +407,8 @@ static void __rcu_process_callbacks(stru
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);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/