RFR: 8365922: Parallel: Group uses of GCTimeRatio to a single location
Albert Mingkun Yang
ayang at openjdk.org
Tue Aug 26 08:24:38 UTC 2025
On Tue, 26 Aug 2025 08:16:25 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
>> Unify all accesses of `GCTimeRatio` to a single place so that Parallel gets a coherence view of its value within the pause, if the global variable's value is ever changed.
>>
>> Test: tier1-3
>
> src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.cpp line 90:
>
>> 88:
>> 89: // Get a local copy and use it inside gc-pause in case the global var gets updated externally.
>> 90: const uint local_GCTimeRatio = GCTimeRatio;
>
> needs an `Atomic::load()` as the compiler is free to re-read the global later at any use of the local.
I was thinking to add that when this flag actually becomes manageable. I don't feel too strongly about it. Do you prefer using atomic already now?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26881#discussion_r2300206747
More information about the hotspot-gc-dev
mailing list