From: Oleg Nesterov Date: Wed, 13 Sep 2006 03:35:55 +0000 (-0700) Subject: [PATCH] rcu_do_batch: make ->qlen decrement irq safe X-Git-Tag: v2.6.18~13^2~18 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd9daa221e77f642954849a795fa7c59533a9b2f;p=linux-2.6 [PATCH] rcu_do_batch: make ->qlen decrement irq safe rcu_do_batch() decrements rdp->qlen with irqs enabled. This is not good, it can also be modified by call_rcu() from interrupt. Decrement ->qlen once with irqs disabled, after a main loop. Signed-off-by: Oleg Nesterov Cc: 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 436ab35f6f..523e46483b 100644 --- a/kernel/rcupdate.c +++ b/kernel/rcupdate.c @@ -241,12 +241,16 @@ static void rcu_do_batch(struct rcu_data *rdp) next = rdp->donelist = list->next; list->func(list); list = next; - rdp->qlen--; if (++count >= rdp->blimit) break; } + + local_irq_disable(); + rdp->qlen -= count; + local_irq_enable(); if (rdp->blimit == INT_MAX && rdp->qlen <= qlowmark) rdp->blimit = blimit; + if (!rdp->donelist) rdp->donetail = &rdp->donelist; else