By: Linus Torvalds (torvalds.delete@this.linux-foundation.org), April 8, 2021 9:56 am
Room: Moderated Discussions
Robert Williams (crispysilicon.delete@this.gmail.com) on April 8, 2021 9:15 am wrote:
> Linus Torvalds (torvalds.delete@this.linux-foundation.org) on April 8, 2021 8:41 am wrote:
> > Sure, that was only one particular implementation (I only
> > ever had one machine that for a while had TSX enabled)
>
> Just out of curiosity, what machine was it? Just trying to get a feel for how long ago.
It's certainly some time ago. I had to go back and try to look in my email archives. Looks like it was a i7-4770S.
I had a TSX patch that actually seemed to improve performance for a while - or at least not make it worse. And then I realized that it was because the non-TSX path was doing unnecessarily stupid things, and when I fixed that, the TSX side was no longer competitive.
But the reason I like transactional memory at least in theory is that the case I was testing would possibly have been faster if it had been just a tiny bit more complicated and the non-TSX path couldn't have been optimized to just do a single cmpxchg for the fast path.
So despite my negative posts here I am a believer in transactional memory in theory. I just think it needs to be done really really well to work.
Of course, one issue is that as long as it's (a) badly done and (b) only available on some machines, you always have to have the conditional "transaction or not" model, and then just that complexity ends up easily meaning that it's not worth it.
Linus
> Linus Torvalds (torvalds.delete@this.linux-foundation.org) on April 8, 2021 8:41 am wrote:
> > Sure, that was only one particular implementation (I only
> > ever had one machine that for a while had TSX enabled)
>
> Just out of curiosity, what machine was it? Just trying to get a feel for how long ago.
It's certainly some time ago. I had to go back and try to look in my email archives. Looks like it was a i7-4770S.
I had a TSX patch that actually seemed to improve performance for a while - or at least not make it worse. And then I realized that it was because the non-TSX path was doing unnecessarily stupid things, and when I fixed that, the TSX side was no longer competitive.
But the reason I like transactional memory at least in theory is that the case I was testing would possibly have been faster if it had been just a tiny bit more complicated and the non-TSX path couldn't have been optimized to just do a single cmpxchg for the fast path.
So despite my negative posts here I am a believer in transactional memory in theory. I just think it needs to be done really really well to work.
Of course, one issue is that as long as it's (a) badly done and (b) only available on some machines, you always have to have the conditional "transaction or not" model, and then just that complexity ends up easily meaning that it's not worth it.
Linus