[aarch64-port-dev ] Request for Approval: Backport patches to fix volatile access inconsistency

Yangfei (Felix) felix.yang at huawei.com
Mon Aug 12 08:43:19 UTC 2019


Hi,



Could I have a review of the following AArch64-specific backport to jdk8u-shenandoah please?

    Webrev: http://cr.openjdk.java.net/~fyang/mm-8u-backport/webrev.00/



We are witnessing real-world volatile access inconsistency bugs on our Kunpeng 64/128 core server platform.

As pointed out on JDK-8179954 and JDK-8209420, C2 should always emit LDAR/STLR for volatile accesses.

For this to work properly the aarch64 backend has to locate membars that go with a memory access to elide them.

This is currently implemented with some complicated pattern matching for the 8u-aarch64 port.

We found it failed for certain cases due to unexpected C2 graph shapes one of which looks like:



   LoadX[mo_unordered]   LoadX[mo_acquire]

          //         \\      //

                     Phi

                   //   \\

                        MemBarAcquire



Pattern matching will not consider the Phi node here for this case.  As a result, C2 emits a combination of ldr and dmb ishld for the volatile read access.

We also see other graph shapes.  JDK-8209420 fixed this issue with a better solution: tracking members for volatile accesses from the start.



Webrev includes the following 5 patches in time order (4 and 5 are follow-up fixes for 3) :

    1. https://bugs.openjdk.java.net/browse/JDK-8179954

      http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/38a240fd58a2



    2. https://bugs.openjdk.java.net/browse/JDK-8206163

      http://hg.openjdk.java.net/jdk/jdk11/rev/8df91a1b549b



3. https://bugs.openjdk.java.net/browse/JDK-8209420

  http://hg.openjdk.java.net/jdk/jdk/rev/d7029542d67a



4. https://bugs.openjdk.java.net/browse/JDK-8211233

  http://hg.openjdk.java.net/jdk/jdk/rev/bbc90467f354



5. https://bugs.openjdk.java.net/browse/JDK-8214857

  http://hg.openjdk.java.net/jdk/jdk/rev/6e7db888f04c



3 fixes volatile access inconsistency issue for C2.  1 handles the case for C1 and template interpreter.

2 is included because in fact it is also a pattern matching issue and it changes some shared part with 3.

The backport patch for 3 includes tweaks for tracking members which corresponds to changes in barrierSetC2.cpp of the original patch.



Testing:

Jtreg tested with both 8u aarch64 fastdebug build and release build.

Passed Jcstress test with TieredCompilation option turned on & off.

Thanks,
Felix


More information about the aarch64-port-dev mailing list