RFR: 8306734: Shenandoah: Missing barriers on deoptimization path [v3]

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


On Tue, 25 Apr 2023 12:39:05 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`
>
> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Revert Shenandoah-specific code

Testing is okay, the GHA failures are known.

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

PR Comment: https://git.openjdk.org/jdk/pull/13613#issuecomment-1522252461


More information about the shenandoah-dev mailing list