RFR: 8306734: Shenandoah: Missing barriers on deoptimization path [v3]
Aleksey Shipilev
shade at openjdk.org
Tue Apr 25 12:39:05 UTC 2023
> AFAICS, Loom integration ([JDK-8284161](https://bugs.openjdk.org/browse/JDK-8284161)) moved the Shenandoah block `StackValue::create_stack_value` that we added to avoid exposing bad oops during the deopt ([JDK-8224522](https://bugs.openjdk.org/browse/JDK-8224522)). I think that was done to avoid interaction with barrier healing acting on derived pointer bases (?), so it employed the `NativeAccess::load_oop` trick to still call into GC barriers without healing. Then, the refactoring for ZGC ([JDK-8296875](https://bugs.openjdk.org/browse/JDK-8296875)) redid these paths, but dropped the `NativeAccess::load_oop` completely, which exposed Shenandoah to a missing barrier.
>
> Serial, Parallel, G1 are not affected by this, because they do not need load-barriers. Not sure why ZGC is not affected by this, but probably because it does the barrier injection in another place (see [JDK-8224675](https://bugs.openjdk.org/browse/JDK-8224675)).
>
> There are two ways to fix it: with the Shenandoah-specific barrier injection, or reinstating the `NativeAccess::load_oop` trick Loom integration originally did. I preferred to keep the fix GC-agnostic and reinstate the `NA::load_oop`. AFAIU, this would be innocuous for other GCs, ZGC included.
>
> Attention: @fisk.
>
> Additional testing:
> - [x] Reproducer from the bug is no longer failing; used to fail 1/2 times on 3 platforms; does not fail after 50 tries
> - [x] Linux x86_64 fastdebug `hotspot_gc_shenandoah`
> - [x] Linux AArch64 fastdebug `hotspot_gc_shenandoah`
Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
Revert Shenandoah-specific code
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/13613/files
- new: https://git.openjdk.org/jdk/pull/13613/files/eec9493e..e09cf682
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=13613&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=13613&range=01-02
Stats: 37 lines in 1 file changed: 24 ins; 11 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/13613.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/13613/head:pull/13613
PR: https://git.openjdk.org/jdk/pull/13613
More information about the shenandoah-dev
mailing list