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

Atomic operations with explicit memory barrier

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Fix Version/s: 10.1.1
    • Component/s: OTHER
    • Labels:
      None

      Description

      Currently atomic operations create full memory barrier. This ensures correct program behavior. However weaker memory barriers have lower performance impact and there are many cases when weaker memory barrier is sufficient.

      The idea of this task is to adopt C11 atomic API to some extent, so it is possible to specify memory barriers for atomic operations.

      C11 atomic operations as such seem to be unavailable in many environments. E.g. they appeared only in gcc-4.9. MSVC doesn't seem to support them, same for Solaris Studio.

      It is proposed to use gcc atomic builtins whenever they're available, otherwise fall back to atomic operations with implicit full memory barrier.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              svoj Sergey Vojtovich added a comment -

              Sergei, please review patch for this task. It is committed against 10.0, I will leave up to you to decide into which version it is supposed to be pushed to.

              Show
              svoj Sergey Vojtovich added a comment - Sergei, please review patch for this task. It is committed against 10.0, I will leave up to you to decide into which version it is supposed to be pushed to.
              Hide
              serg Sergei Golubchik added a comment -

              ok to push (in 10.1)

              Show
              serg Sergei Golubchik added a comment - ok to push (in 10.1)
              Hide
              svoj Sergey Vojtovich added a comment -

              Pushed to 10.1.1:

              commit e813f9b9b3a087910b94ffeda968b53f9fca4311
              Author: Sergey Vojtovich <svoj@mariadb.org>
              Date:   Tue Oct 14 14:58:35 2014 +0400
              
                  MDEV-6693 - Atomic operations with explicit memory barrier
              
                  Added API for atomic operations with explicit memory barrier. Only gcc
                  atomic builtins are currently supported. If they're unavailable, fall
                  back to atomic operations with implicit full memory barrier.
              
              Show
              svoj Sergey Vojtovich added a comment - Pushed to 10.1.1: commit e813f9b9b3a087910b94ffeda968b53f9fca4311 Author: Sergey Vojtovich <svoj@mariadb.org> Date: Tue Oct 14 14:58:35 2014 +0400 MDEV-6693 - Atomic operations with explicit memory barrier Added API for atomic operations with explicit memory barrier. Only gcc atomic builtins are currently supported. If they're unavailable, fall back to atomic operations with implicit full memory barrier.

                People

                • Assignee:
                  svoj Sergey Vojtovich
                  Reporter:
                  svoj Sergey Vojtovich
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: