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

Thomas Schatzl tschatzl at openjdk.org
Tue Aug 26 08:18:36 UTC 2025


On Thu, 21 Aug 2025 10:55:23 GMT, Albert Mingkun Yang <ayang 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.

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

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


More information about the hotspot-gc-dev mailing list