[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20060910221704.GH4690@in.ibm.com>
Date: Mon, 11 Sep 2006 03:47:04 +0530
From: Dipankar Sarma <dipankar@...ibm.com>
To: Oleg Nesterov <oleg@...sign.ru>
Cc: "Paul E. McKenney" <paulmck@...ibm.com>,
Srivatsa Vaddagiri <vatsa@...ibm.com>,
Andrew Morton <akpm@...l.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rcu_do_batch: make ->qlen decrement irq safe
On Mon, Sep 11, 2006 at 01:32:43AM +0400, Oleg Nesterov wrote:
> 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 <oleg@...sign.ru>
>
> --- rc6-mm1/kernel/rcupdate.c~ 2006-08-22 16:22:49.000000000 +0400
> +++ rc6-mm1/kernel/rcupdate.c 2006-09-11 01:24:17.000000000 +0400
> @@ -241,12 +241,16 @@ static void rcu_do_batch(struct rcu_data
> 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
Looks good to me.
Thanks
Dipankar
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists