Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-38884

Runtime check for Intel TSX-NI incurs some overhead

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.6, 10.11, 11.4, 11.8, 12.3
    • 10.11, 11.4, 11.8, 12.3
    • AMD64 and IA-32, with and without TSX-NI a.k.a. Restricted Transactional Memory (RTM)
    • Related to performance

    Description

      MDEV-26769 introduced hardware memory transactions for InnoDB, to allow lock elision in some cases. On POWER and s390x, the related HTM feature is always available.

      To my understanding, the rtm ISA extension (xsave, xend, xabort), also known as TSX-NI, is only implemented in some high-end models of Intel® processors. Therefore, on IA-32 and AMD64, we initialize the global variable have_transactional_memory and check it in various places at runtime.

      The call sites are identified by the macros TRANSACTIONAL_TARGET and TRANSACTIONAL_INLINE.

      It would be useful to implement a dispatch by function pointers, so that there would be fewer conditional branches.

      The target_clones function attribute that is available in recent versions of GCC and Clang may incur some limitations based on this report.

      MDEV-37147 is conceptually related, in the way that we would want ISA variant specific clones of some functions, just targeting a different ISA.

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              marko Marko Mäkelä
              Marko Mäkelä Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.