[aarch64-port-dev ] RFR: 8242029: AArch64: skip G1 array copy pre-barrier if marking not active

Nick Gasson nick.gasson at arm.com
Tue Apr 7 07:19:10 UTC 2020


Hi,

Bug: https://bugs.openjdk.java.net/browse/JDK-8242029
Webrev: http://cr.openjdk.java.net/~ngasson/8242029/webrev.0/

Currently on AArch64 the G1GC array copy pre-barrier unconditionally
performs a VM call into G1BarrierSetRuntime, but this is a no-op if
marking is not in progress.

This patch adds a check to skip the call unless marking is in
progress. X86 already has this optimisation and I can't see a reason not
to do it on AArch64 as well.

Tested jtreg hotspot_all_no_apps, jdk_core.

Results of ArrayCopy.arrayCopyObject* JMH benchmarks:

Before:

  Benchmark                                    Mode  Cnt    Score    Error  Units
  ArrayCopy.arrayCopyObject                    avgt   15  117.307 ? 11.607  ns/op
  ArrayCopy.arrayCopyObjectNonConst            avgt   15  107.786 ?  2.692  ns/op
  ArrayCopy.arrayCopyObjectSameArraysBackward  avgt   15   76.381 ?  0.761  ns/op
  ArrayCopy.arrayCopyObjectSameArraysForward   avgt   15   79.519 ?  3.433  ns/op

After:

  Benchmark                                    Mode  Cnt   Score   Error  Units
  ArrayCopy.arrayCopyObject                    avgt   15  86.161 ? 6.150  ns/op
  ArrayCopy.arrayCopyObjectNonConst            avgt   15  83.539 ? 0.682  ns/op
  ArrayCopy.arrayCopyObjectSameArraysBackward  avgt   15  52.388 ? 0.732  ns/op
  ArrayCopy.arrayCopyObjectSameArraysForward   avgt   15  54.619 ? 1.278  ns/op

The VM call overhead can be quite high on AArch64 as we insert a
serialising ISB instruction on every native->Java return.


Thanks,
Nick


More information about the aarch64-port-dev mailing list