RFR: 8261495: Shenandoah: reconsider update references memory ordering [v5]

Aleksey Shipilev shade at openjdk.java.net
Wed Jun 23 15:50:43 UTC 2021


> Shenandoah update heap references code uses default Atomic::cmpxchg to avoid races with mutator updates. Hotspot's default for atomic operations is memory_order_conservative, which emits two-way memory fences around the CASes at least on AArch64 and PPC64.
> 
> This seems to be excessive for Shenandoah update references code, and "release" is enough. We do not seem to piggyback on update-references memory effects anywhere (in fact, if not for mutator, we would not even need a CAS). But, there is an interplay with concurrent evacuation and updates from self-healing.
> 
> Average time goes down, the number of GC cycles go up, since the cycles are shorter.
> 
> Additional testing:
>  - [x] Linux x86_64 hotspot_gc_shenandoah
>  - [x] Linux AArch64 hotspot_gc_shenandoah
>  - [x] Linux AArch64 tier1 with Shenandoah

Aleksey Shipilev has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 10 additional commits since the last revision:

 - Mention stronger-than-relaxed memory ordering
 - Comment touchup
 - Specialize out witness-checking methods, drop acquire again
 - Even more explanation
 - Move the comment
 - Also handle clearing the oops
 - Minor touchups to the comment
 - Use release only
 - Do acq_rel instead
 - 8261495: Shenandoah: reconsider update references memory ordering

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/2498/files
  - new: https://git.openjdk.java.net/jdk/pull/2498/files/0d299968..a033e37a

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2498&range=04
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2498&range=03-04

  Stats: 1379432 lines in 14417 files changed: 693773 ins; 633503 del; 52156 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2498.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2498/head:pull/2498

PR: https://git.openjdk.java.net/jdk/pull/2498


More information about the hotspot-gc-dev mailing list