Re: [RFC][PATCH 6/8] mm: handle_speculative_fault()

From: Linus Torvalds
Date: Tue Jan 05 2010 - 15:47:17 EST




On Tue, 5 Jan 2010, Peter Zijlstra wrote:
>
> On Tue, 2010-01-05 at 10:25 -0800, Linus Torvalds wrote:
> > The readers are all hitting the
> > lock (and you can try to solve the O(n*2) issue with back-off, but quite
> > frankly, anybody who does that has basically already lost
>
> /me sneaks in a reference to local spinning spinlocks just to have them
> mentioned.

Were you in on the discussion with (I think) Andy Glew about that? I don't
think he ever came up with an actual workable solution, but he tried. He
worked for Intel at the time (maybe still does), and was looking at
architectural improvements. I think you need a "compare-and-exchange-2-
separate-words" instruction to make it work (not "cmpxchg8/16b" -
literally two _different_ words).

I think m68k can do it. Even then it's a lot more expensive than a regular
lock for any reasonable common case.

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/