RFR: 8372645: ParallelGC: Remove race between allocation and expansion before is_init_completed
Albert Mingkun Yang
ayang at openjdk.org
Mon Dec 1 14:39:10 UTC 2025
On Mon, 1 Dec 2025 10:52:57 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:
> JDK-8370943 added the ability to expand the heap for Serial and Parallel without having to GC during early startup (before `is_init_completed`). The expansion code was written with the assumption that it is performed in a safepoint.
>
> We have currently observed one crash related to the fact that top is updated before we setup the card table.
>
> I propose that we create a critical section for the early expansion and any early allocation.
>
> We might want to relax this critical section in the future, after we have fixed the expansion code and allocation interactions. But for now it seems safer to simply use a mutex.
>
> _We also looked at using a RW style lock, but deemed it a bit unnecessary (https://github.com/openjdk/jdk/compare/master...xmas92:jdk:pre-init-expansion-rw-lock). Any potential performance gain may be better achieved by simply resolving the synchronisation issues with expansion._
>
> * Testing
> * GHA
> * Tier 1-3 on Oracle supported platforms
Marked as reviewed by ayang (Reviewer).
-------------
PR Review: https://git.openjdk.org/jdk/pull/28574#pullrequestreview-3525319846
More information about the hotspot-gc-dev
mailing list