RFR: 8261495: Shenandoah: reconsider update references memory ordering [v7]
Aleksey Shipilev
shade at openjdk.java.net
Tue Jun 29 12:33: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. For example, `SPECjvm2008:compiler.sunflow`:
>
>
> # Before
> [172.931s][info][gc,stats] Concurrent Update Refs = 9.866 s (a = 60161 us)
> [283.225s][info][gc,stats] Concurrent Update Refs = 8.274 s (a = 57859 us)
> [232.514s][info][gc,stats] Concurrent Update Refs = 9.321 s (a = 58991 us)
> [215.495s][info][gc,stats] Concurrent Update Refs = 9.233 s (a = 58434 us)
> [217.557s][info][gc,stats] Concurrent Update Refs = 9.153 s (a = 58672 us)
>
> # After
> [169.752s][info][gc,stats] Concurrent Update Refs = 8.150 s (a = 49697 us)
> [168.798s][info][gc,stats] Concurrent Update Refs = 8.430 s (a = 51092 us)
> [166.353s][info][gc,stats] Concurrent Update Refs = 8.812 s (a = 54395 us)
> [236.542s][info][gc,stats] Concurrent Update Refs = 8.215 s (a = 51026 us)
> [214.006s][info][gc,stats] Concurrent Update Refs = 8.244 s (a = 52175 us)
>
>
> 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 three additional commits since the last revision:
- Comment tune-ups
- Merge branch 'master' into JDK-8261495-shenandoah-updaterefs-memord
- 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/71f419f1..3adc78b4
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2498&range=06
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2498&range=05-06
Stats: 15989 lines in 418 files changed: 6031 ins; 8537 del; 1421 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