Integrated: 8306734: Shenandoah: Missing barriers on deoptimization path

Aleksey Shipilev shade at openjdk.org
Tue Apr 25 18:50:21 UTC 2023


On Mon, 24 Apr 2023 11:44:16 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> 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`

This pull request has now been integrated.

Changeset: 28829f30
Author:    Aleksey Shipilev <shade at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/28829f308fe6314388c9a47b91273bcf81eb806c
Stats:     26 lines in 1 file changed: 24 ins; 0 del; 2 mod

8306734: Shenandoah: Missing barriers on deoptimization path

Reviewed-by: eosterlund, rkennke

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

PR: https://git.openjdk.org/jdk/pull/13613


More information about the shenandoah-dev mailing list