Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8320167

aarch64: lightweight locking could possibly use fewer memory barriers

    XMLWordPrintable

Details

    • aarch64

    Description

      The recent aarch64 implementation uses "/*acquire*/ true, /*release*/ true" semantics in both, MacroAssembler::lightweight_lock and MacroAssembler::lightweight_unlock.
      For locking purposes, it is sufficient to use lock-acquire and release-unlock. Especially the lock operation does not need to release anything like the displaced header in legacy locking mode.
      Regarding the memory model, https://github.com/openjdk/jcstress/blob/ce8a2c7747e0232fac66783c89ea4a58a3819e0f/jcstress-samples/src/main/java/org/openjdk/jcstress/samples/jmm/advanced/AdvancedJMM_01_SynchronizedBarriers.java#L56 and other similar tests indicate that the JMM doesn't have additional requirements.
      We should check if weaker semantics are correct and improve performance.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mdoerr Martin Doerr
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated: