RFR: 8373100: Genshen: Control thread can miss allocation failure notification [v2]

Xiaolong Peng xpeng at openjdk.org
Thu Dec 11 16:54:15 UTC 2025


On Thu, 11 Dec 2025 16:03:10 GMT, William Kemper <wkemper at openjdk.org> wrote:

>> While I was staring at the code ShenandoahController::handle_alloc_failure today, I found there is discrepancy between ShenandoahGenerationalControlThread and  ShenandoahControlThread, I created a [bug](https://bugs.openjdk.org/browse/JDK-8373468) to unify the behavior, we could fix the issue in ShenandoahControlThread there.
>
> The scenario I described wasn't supposition, that is actually what happened in the debugger. The scenario you describe with `op_final_update_refs` would also be fixed by this PR. The `_requested_gc_cause` field should always be accessed under a lock. The code change here fixes an issue where an allocation failure might not set `_requested_gc_cause` at all.

Yes, I understand the fix will solve the issue for genshen and also fix scenario I described.
I'll solve the potential issue in non-generational Shenandoah in the [PR](https://github.com/openjdk/jdk/pull/28758) to fix the behavior differences in Genshen and non-generational Shenandoah.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28665#discussion_r2611334636


More information about the hotspot-gc-dev mailing list