Intel RTM and HLE is a success (is it?)

By: Linus Torvalds (torvalds.delete@this.linux-foundation.org),
Room: Moderated Discussions
Andrey (andrey.semashev.delete@this.gmail.com) on March 31, 2021 5:27 am wrote:
>
> You obviously have to write non-transactional path, and it will have its pitfalls, but the point
> is that you could have better best-case and average performance with TSX.

No, you really really don't.

TSX was slow even when it worked and didn't have aborts, and never gave you "best-case" performance at all due to that. Simple non-contended non-TSX locks worked better.

And TSX was a complete disaster when you had any data contention, and just caused overhead and aborts and fallbacks to locked code, so - no surprise - plain non-TSX locks worked better. And data contention is quite common, and happened for a lot of trivial reasons (statistics being one).

And no, TSX didn't have better average performance either, because in order to avoid the problems, you had to do statistics in software, which added its own set of overhead.

As far as I know, there were approximately zero real-world loads that were better with TSX than without.

The only case that TSX ever did ok on was when there was zero data contention at all, and lots of cache coherence costs due almost entirely due to locking, and then TSX can keep the lock as a shared cache line. Yes, this really can happen, but most of the time it happens is when you also have big enough locked regions that they don't get caught by the transactional memory due to size overflows.

And making the transaction size larger makes the costs higher too, so now you need to do a much better job at predicting ahead of time whether transactions will succeed or not. Which Intel entirely screwed up, and I blame them completely. I told them at the first meeting they had (before TSX was public) that they need to add a TSX predictor, and they never did.

And the problems with TSX were legion, including dat aleaks and actual outright memory ordering bugs.

TSX was garbage, and remains so.

This is not to say that you couldn't get transactional memory right, but as it stands right now, I do not believe that anybody has ever had an actual successful and useful implementation of transactional memory.

And I can pretty much guarantee that to do it right you need to have a transaction success predictor (like a branch predictor) so that software doesn't have to deal with yet another issue of "on this uarch, and this load, the transaction size is too small to fit this lock".

I'm surprised that ARM made it part of v9 (and surprised that ARM kept the 32-bit compatibility part - I really thought they wanted to get rid of it).

Linus
< Previous Post in ThreadNext Post in Thread >
Thread (188 posts)
TopicPosted ByPosted
Armv9 officially announcedJon Masters
  Armv9 officially announcedGabriele Svelto
    HTM and TLEFoo_
      HTM and TLEdmcq
      Intel RTM and HLE is a successGanon
        Intel RTM and HLE is a success (is it?)Foo_
          Intel RTM and HLE was an abject failureanonymou5
          Intel RTM and HLE is a success (is it?)Andrey
            Intel RTM and HLE is a success (is it?)Foo_
              Intel RTM and HLE is a success (is it?)Andrey
                Intel RTM and HLE is a success (is it?)Foo_
                  Intel RTM and HLE is a success (is it?)Andrey
                    Intel RTM and HLE is a success (is it?)anonymou5
                      ^ feel free to delete this one -- broken HTML there (NT)anonymou5
                      Intel RTM and HLE is a success (is it?)Andrey
                    Intel RTM and HLE is a success (is it?)anonymou5
                Intel RTM and HLE is a success (is it?)Ganon
                  Intel RTM and HLE is a success (is it?)anonymou5
                  Intel RTM and HLE is a success (is it?)Linus Torvalds
                    Intel RTM and HLE is a success (is it?)Linus Torvalds
                      Any idea about IBM?Mark Roulo
                        Any idea about IBM?Linus Torvalds
                          Any idea about IBM?dmcq
                            Any idea about IBM?Linus Torvalds
                              A non straw man view of hardware transactional memoryGanon
                                A non straw man view of hardware transactional memoryanon2
                                  A non straw man view of hardware transactional memoryCarson
                                    A non straw man view of hardware transactional memoryanon2
                              IBM zArch TM - guaranteed progressDavid Kanter
                              Any idea about IBM?Andrey
                                Any idea about IBM?Linus Torvalds
                                  Any idea about IBM?Andrey
                        Any idea about IBM?someone
                      Intel RTM and HLE is a success (is it?)anon2
                        Intel RTM and HLE is a success (is it?)Linus Torvalds
                          Leaving it to software is tricky!David Kanter
                            And a hardware predicttor needs access to fallback timingCarson
                              Hardware fallback pathAnon
                              And a hardware predicttor needs access to fallback timingLinus Torvalds
                                And a hardware predicttor needs access to fallback timingLinus Torvalds
                                  And a hardware predicttor needs access to fallback timingsr
                                    And a hardware predicttor needs access to fallback timingLinus Torvalds
                                      And a hardware predicttor needs access to fallback timingsr
                                        And a hardware predicttor needs access to fallback timingAnon
                                          And a hardware predicttor needs access to fallback timingsr
                                            And a hardware predicttor needs access to fallback timingdmcq
                                        And a hardware predicttor needs access to fallback timingLinus Torvalds
                                          Transactional memory isn't exclusive to lockingsr
                                            Transactional memory isn't exclusive to lockingAspect of Anonimity
                                            Transactional memory isn't exclusive to lockingAndrey
                                              Transactional memory isn't exclusive to lockingsr
                                                Transactional memory isn't exclusive to lockingAndrey
                                                  Transactional memory isn't exclusive to lockingsr
                                      And a hardware predicttor needs access to fallback timingGeertB
                            Leaving it to software is tricky!Andrey
                          Intel RTM and HLE is a success (is it?)@never_released
                            Intel RTM and HLE is a success (is it?)@never_released
                            Intel RTM and HLE is a success (is it?)Linus Torvalds
                              Intel RTM and HLE is a success (is it?)dmcq
                                Intel RTM and HLE is a success (is it?)Linus Torvalds
                                  Is HTM actually in ARMv9?dncq
                                    Is HTM actually in ARMv9?Linus Torvalds
                              Intel RTM and HLE is a success (is it?)Jörn Engel
                          Intel RTM and HLE is a success (is it?)---
                      Intel RTM and HLE is a success (is it?)Jon Masters
                        RockMichael S
            Intel RTM and HLE is a success (is it?)Linus Torvalds
              Intel RTM and HLE is a success (is it?)anon2
                Intel RTM and HLE is a success (is it?)anon3
          Intel RTM and HLE is a success (is it?)someone
            Intel RTM and HLE is a success (is it?)someone
              Intel RTM and HLE is a success (is it?)none
                Intel RTM and HLE is a success (is it?)anonymou5
                  Intel RTM and HLE is a success (is it?)anony
                  Intel RTM and HLE is a success (is it?)none
                Intel RTM and HLE is a success (is it?)Brendan
                  Intel RTM and HLE is a success (is it?)Adrian
      Transactional memory similarity to garbage collectionPaul A. Clayton
        Maybe notMark Roulo
        Transactional memory similarity to garbage collectionAnon
        No conflict between theory and practiceAspect of Anonimity
          No conflict between theory and practiceNoSpammer
            No conflict between theory and practicedmcq
              No conflict between theory and practicesr
                No conflict between theory and practiceBen LaHaise
                  No conflict between theory and practicesr
                    No conflict between theory and practiceAnon
                    No conflict between theory and practiceLinus Torvalds
                      No conflict between theory and practicesr
                        If HTM were well implemented, nobody would complain (NT)Anon
                          If HTM were well implemented, nobody would complaindmcq
                            If HTM were well implemented, nobody would complainAnon
                          If HTM were well implemented, nobody would complain---
                        No conflict between theory and practiceLinus Torvalds
                          No conflict between theory and practiceAndrey
                            No conflict between theory and practicedmcq
                              No conflict between theory and practiceanonymou5
                              No conflict between theory and practiceAndrey
                                No conflict between theory and practiceLinus Torvalds
                                  No conflict between theory and practiceAndrey
                                  No conflict between theory and practiceRobert Williams
                                    No conflict between theory and practiceLinus Torvalds
                                      No conflict between theory and practiceRobert Williams
                                        No conflict between theory and practiceLinus Torvalds
                                          TSX for all?Robert Williams
                                            It helps adoption when developers can run the code an their machines.Mark Roulo
                                              It helps adoption when developers can run the code an their machines.me
                                                It helps adoption when developers can run the code an their machines.Andrey
                                                  It helps adoption when developers can run the code an their machines.me
                                                    It helps adoption when developers can run the code an their machines.Robert Williams
                                                      It helps adoption when developers can run the code an their machines.Andrey
                                                        It helps adoption when developers can run the code an their machines.Michael S
                                              It helps adoption when developers can run the code an their machines.Robert Williams
                                                It helps adoption when developers can run the code an their machines.Andrey
                                                  It helps adoption when developers can run the code an their machines.Michael S
                                                    It helps adoption when developers can run the code an their machines.Robert Williams
                                                    It helps adoption when developers can run the code an their machines.Brendan
                                                      It helps adoption when developers can run the code an their machines.Michael S
                                                        It helps adoption when developers can run the code an their machines.Brendan
                                            TSX for all?wumpus
                                            TSX for all?Linus Torvalds
                                              [CLICK BAIT?] Torvalds to recommend arm64!anonymous2
                                              TSX for all?Linus Torvalds
                                                amen! (NT)anonymou5
                                            TSX for all?Emil Briggs
                                              TSX for all?Michael S
                                                TSX for all?Brendan
                                          No conflict between theory and practiceanonymouse
                            No conflict between theory and practiceLinus Torvalds
                              No conflict between theory and practiceAndrey
                                No conflict between theory and practiceanon2
                                  No conflict between theory and practiceAndrey
                                    No conflict between theory and practiceAnon
                                    No conflict between theory and practiceanon2
                                      No conflict between theory and practiceAndrey
                                        No conflict between theory and practiceAdrian
                                          No conflict between theory and practiceAndrey
                                            No conflict between theory and practiceAdrian
                                            No conflict between theory and practiceanon2
                                              No conflict between theory and practiceAndrey
                                                No conflict between theory and practiceanon2
                                                  No conflict between theory and practiceAndrey
                                                    No conflict between theory and practiceanon2
                                            No conflict between theory and practice---
                                              No conflict between theory and practicedmcq
                                                No conflict between theory and practiceLinus Torvalds
                                        No conflict between theory and practiceanon2
                                          No conflict between theory and practicesr
                                            No conflict between theory and practiceAnon
                                              No conflict between theory and practiceEtienne Lorrain
                                                No conflict between theory and practiceAnon
                                                  No conflict between theory and practicedmcq
                              No conflict between theory and practiceGabriele Svelto
                                No conflict between theory and practicedmcq
                                  No conflict between theory and practicedmcq
                      transactional memory = memory lock/unlocksr
                        transactional memory = memory lock/unlockAnon
                    No conflict between theory and practiceanon2
                No conflict between theory and practicedmcq
            No conflict between theory and practiceAnon
            No conflict between theory and practiceAspect of Anonimity
              No conflict between theory and practiceNoSpammer
                No conflict between theory and practicesr
                No conflict between theory and practiceAspect of Anonimity
                  No conflict between theory and practiceAndrey
                    HmAspect of Anonimity
                      Special internal SRAM to store Mutex?Etienne Lorrain
                        Special internal SRAM to store Mutex?Anon
                        Special internal SRAM to store Mutex?Linus Torvalds
                        Special internal SRAM to store Mutex?Dan Fay
                          Special internal SRAM to store Mutex?Ben LaHaise
                          Special internal SRAM to store Mutex?Gabriele Svelto
                        Special internal SRAM to store Mutex?Carson
          No conflict between theory and practicesr
            No conflict between theory and practiceAnon
            No conflict between theory and practiceAspect of Anonimity
              No conflict between theory and practicesr
                No conflict between theory and practiceanon2
  Armv9 officially announceddmcq
    Totally backwads logic on compatibilityHeikki Kultala
      Totally backwads logic on compatibilityDoug S
        Totally backwads logic on compatibilitydmcq
  Armv9 officially announcedv9
    Armv9 officially announcedj
      Armv9 officially announcedDoug S
        Armv9 officially announcedanonymou5
          Armv9 officially announcedDoug S
        Armv9 officially announceddmcq