RFR: 8369392: Safepoint sync should suspend GC and Java threads concurrently
Stefan Karlsson
stefank at openjdk.org
Tue Oct 28 06:56:01 UTC 2025
On Tue, 21 Oct 2025 20:00:15 GMT, Xiaolong Peng <xpeng at openjdk.org> wrote:
> As @shipilev mentioned in the description description of [JDK-8369392](https://bugs.openjdk.org/browse/JDK-8369392), we could rearrange the code and ask GC to suspend after announcing safepoint, GC threads and Java threads will sync simultaneously. [The other option](https://github.com/openjdk/jdk/pull/27739/files) I have test is to split STS synchronize into `synchronize_begin` and `synchronize`, which makes GC thread suspension fully aysnc(same Java threads), but I didn't see big performance difference, therefore I chose the simple solution suggested by Aleksey.
>
>
> Test:
> - [x] tier1
I don't think this should be done for ZGC. We intentionally perform the lengthy GC syncronization before we start to synchronize the Java thread. With the proposed change the Java threads could end up blocking longer because they now also have to wait for the GC threads to synchronize.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27924#issuecomment-3454890490
More information about the hotspot-runtime-dev
mailing list