Re: [PATCH/RFC] Futex mmap_sem deadlock

Benjamin Herrenschmidt
2005-02-22T21:43:55Z

On Tue, 2005-02-22 at 13:31 -0800, Linus Torvalds wrote:
>
> On Wed, 23 Feb 2005, Benjamin Herrenschmidt wrote:
> >
> > Isn't Olof scheme racy ? Can't the stuff get swapped out between the
> > first get_user() and the "real" one ?
>
> Yes. But see my suggested modification (which I still think is "the thing
> that Olof does", except it's more efficient and avoids the race).
>
> If rwsems acted like rwlocks, we wouldn't have this issue at all.

Yours is probably the most efficient too. Note sure what is best for
rwsems tho, there seem to be some interest preventing readers from
starving writers for ever, this has been debated endlessly iirc,
though I have no personal opinion there.

Ben.