RFR: 8356667: GenShen: Eliminate races with ShenandoahFreeSet::available() [v2]

Kelvin Nilsen kdnilsen at openjdk.org
Mon May 12 23:22:33 UTC 2025


> Two changes:
> 
> 1. Compute the difference between capacity and used while holding the heap lock (so that these two values do not change in incompatible ways while the difference is being computed)
> 2. Return a "harmless" Sentinel value in case available() is consulted while we are in the process of rebuilding the freeset.  The SIZE_MAX value is considered harmless in that it will not cause immediate trigger of a new GC.  In typical usage, the control or regulator thread will check available() again in another millisecond, at which time a more accurate accounting of available will be provided (if the freeset reconstruction has been completed).

Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision:

  Respond to reviewer comments

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/25165/files
  - new: https://git.openjdk.org/jdk/pull/25165/files/6353f1f7..ffe1113e

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=25165&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25165&range=00-01

  Stats: 3 lines in 2 files changed: 0 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/25165.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25165/head:pull/25165

PR: https://git.openjdk.org/jdk/pull/25165


More information about the hotspot-gc-dev mailing list