Re: [PATCH 00/18] x86: Ticket lock + cmpxchg cleanup

From: Linus Torvalds
Date: Wed Aug 24 2011 - 19:21:43 EST


On Wed, Aug 24, 2011 at 4:09 PM, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> However, the reason I disagree with it is that I don't think that it's
> any prettier at all to have the two barriers than it is to just have
> the asm.

.. and btw, we probably do need *both* barriers. We definitely need
the one before. The one after is a bit less obvious, since it is
technically legal for code to move into the locked region. However,
it's not necessarily a *good* idea for code to move into the locked
region, so the two barriers are likely the RightThing(tm). But the two
barriers are what makes me think that the C version really isn't any
better. And the OOSTORE case then just clinches the deal for me.

Linus
--
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/