RFR: 8365922: Parallel: Group uses of GCTimeRatio to a single location

Thomas Schatzl tschatzl at openjdk.org
Wed Aug 27 09:22:43 UTC 2025


On Tue, 26 Aug 2025 08:22:24 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> 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?

I prefer to either do this with that change then, or have the change complete. Separating the main change out seems prone for errors, and no different than not having this patch in.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26881#discussion_r2303375182


More information about the hotspot-gc-dev mailing list