Re: [rfc] "fair" rw spinlocks

From: Paul E. McKenney
Date: Mon Nov 30 2009 - 13:29:37 EST


On Mon, Nov 30, 2009 at 06:13:33PM +0100, Nick Piggin wrote:
> On Mon, Nov 30, 2009 at 09:05:57AM -0800, Linus Torvalds wrote:
> Secondly:
>
> > static void tasklist_read_lock(void)
> > {
> > preempt_disable();
> > if (!current->tasklist_count++)
>
> What happens if an interrupt and nested tasklist_read_lock() happens
> here?

Ouch!!! This race affects the reader-writer-lock version as well.
Ah well, looks like interrupt disabling is required either way.

Thanx, Paul
--
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/