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

Enable spinning for log_sys_mutex and log_flush_order_mutex

Details

    Description

      As part of MDEV-26779 we first discovered the effect of enabling spinning for some critical mutex.
      MDEV-26779 tried enabling it for lock_sys.wait_mutex and observed a good gain in performance.

      In yet another discussion, Mark Callaghan pointed to a reference to pthread based mutex spin using PTHREAD_MUTEX_ADAPTIVE_NP (MDEV-26769 Intel RTM).

      Given the strong references, Marko Makela as part of his comment in #1923 pointed an idea to enable
      spinning for other mutexes. Based on perf profiling we decided to explore spinning for
      log_sys_mutex and log_flush_order_mutex as they are occupying the top slots in the contented mutex list.

      The evaluation showed promising results for ARM64 but not for x86.
      So a patch is here-by proposed to enable the spinning of the mutex for ARM-based platform.

      Attachments

        1. arm.png
          arm.png
          90 kB
        2. x86.png
          x86.png
          89 kB

        Issue Links

          Activity

            krunalbauskar Krunal Bauskar added a comment - patch submitted: https://github.com/MariaDB/server/pull/1935

            On ARM, performance gain in the range of 10-60% is observed.

            krunalbauskar Krunal Bauskar added a comment - On ARM, performance gain in the range of 10-60% is observed.

            The spinloops were deliberately disabled as part of MDEV-23855 already in MariaDB Server 10.5.7.

            Several things have changed between 10.5 and 10.6, so it is not too surprising that the spinning may be helpful again.

            marko Marko Mäkelä added a comment - The spinloops were deliberately disabled as part of MDEV-23855 already in MariaDB Server 10.5.7. Several things have changed between 10.5 and 10.6, so it is not too surprising that the spinning may be helpful again.

            People

              marko Marko Mäkelä
              krunalbauskar Krunal Bauskar
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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