RFR: 8373468: Shenandoah: Mutator may block at _gc_waiters_lock after allocation failure even block parameter is false [v3]
William Kemper
wkemper at openjdk.org
Thu Dec 11 17:47:50 UTC 2025
On Thu, 11 Dec 2025 17:38:43 GMT, Xiaolong Peng <xpeng at openjdk.org> wrote:
>> There is behavior discrepancy between Shenandoah generational mode and non-generational when it handles mutator allocation failure, as stated in the description of [JDK-8373468](https://bugs.openjdk.org/browse/JDK-8373468), in non-generational, the `block` parameter may not always work.
>>
>> Further looking into ShenandoahGenerationalControlThread and ShenandoahControlThread, they handle the _requested_gc_cause and ShenandoahHeap::cancelled_cause differently in other places as well, the change in this PR will minimize the gap to unify the behavior, and also fix potentially missed allocation failure notifications in some rare cases for both control threads.
>>
>> ### Test
>> - [x] hotspot_gc_shenandoah
>> - [x] GHA (includes tier1 but no unit unit with gtest)
>> - [x] [x] gtest
>
> Xiaolong Peng has updated the pull request incrementally with one additional commit since the last revision:
>
> Only load _requested_gc_cause once when figuring out pending requests
Changes requested by wkemper (Reviewer).
src/hotspot/share/gc/shenandoah/shenandoahControlThread.hpp line 46:
> 44:
> 45: ShenandoahSharedFlag _gc_requested;
> 46: Atomic<GCCause::Cause> _requested_gc_cause;
`_requested_gc_cause` should always be accessed when holding the `_control_lock`. Making this atomic should not be unnecessary.
-------------
PR Review: https://git.openjdk.org/jdk/pull/28758#pullrequestreview-3568599040
PR Review Comment: https://git.openjdk.org/jdk/pull/28758#discussion_r2611507205
More information about the hotspot-gc-dev
mailing list