On Fri, Dec 28, 2018 at 1:48 PM Linus Torvalds
[off-list ref] wrote:
Maybe I'm missing something, but this really looks like a completely
invalid "optimization" to me. And it's entirely bogus too. If that
memory barrier matters, you're almost certainly doing something wrong
(most likely benchmarking something pointless).
Note: I have pulled the tree, but I expect this to be either reverted,
or explained why it really is correct.
Because right now it just looks to be like a race condition that
generates faster - but incorrect - code.
The race may be practically impossible to hit simply because the other
side is slow and heavy (and you need to hit the timing just right),
but I don't see what would keep it from fundamentally happening. The
"this happens in a blue moon on just very specific hardware" bugs are
the worst kind of bugs.
Linus