[jdk11u-dev] RFR: 8252857: AArch64: Shenandoah C1 CAS is not sequentially consistent

Aleksey Shipilev shade at openjdk.java.net
Tue Aug 24 17:49:05 UTC 2021


Unclean backport to fix Shenandoah AArch64 bug. The patch does not apply cleanly, because there is a trivial conflict in a copyright line. Then it fails to build, because the check in `LIR_OpShenandoahCompareAndSwap::emit_code` should match the 11u version.

In JDK mainline:


void LIRGenerator::volatile_field_load(LIR_Address* address, LIR_Opr result, * info) {
  ....
  if (!CompilerConfig::is_c1_only_no_jvmci()) {
    __ membar();
  }
  __ volatile_load_mem_reg(address, result, info);
}
...
void LIR_OpShenandoahCompareAndSwap::emit_code(LIR_Assembler* masm) {
  ...
  if (CompilerConfig::is_c1_only_no_jvmci()) {
    ...
    __ membar(__ AnyAny);
  }
}


In JDK 11u (this PR):


void LIRGenerator::volatile_field_load(LIR_Address* address, LIR_Opr result,
                                       CodeEmitInfo* info) {
  ...
  if (! UseBarriersForVolatile) {
    __ membar();
  }
   __ volatile_load_mem_reg(address, result, info);
}

void LIR_OpShenandoahCompareAndSwap::emit_code(LIR_Assembler* masm) {
  ...
  if (UseBarriersForVolatile) {
     ...
     __ membar(__ AnyAny);
  }
}


Additional testing:
 - [x] Linux AArch64 hotspot_gc_shenandoah
 - [x] Linux AArch64 tier1 with -XX:+UseShenandoahGC
 - [x] Linux AArch64 tier2 with -XX:+UseShenandoahGC
 - [ ] Linux AArch64 jcstress -m quick with -XX:+UseShenandoahGC

-------------

Commit messages:
 - Fix the 11u build failure: use UseBarriersForVolatile instead
 - Backport 8e87d46f41e663f5d0506554054417e3049175e7

Changes: https://git.openjdk.java.net/jdk11u-dev/pull/289/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk11u-dev&pr=289&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8252857
  Stats: 52 lines in 2 files changed: 10 ins; 30 del; 12 mod
  Patch: https://git.openjdk.java.net/jdk11u-dev/pull/289.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk11u-dev pull/289/head:pull/289

PR: https://git.openjdk.java.net/jdk11u-dev/pull/289


More information about the jdk-updates-dev mailing list