Integrated: 8356667: GenShen: Eliminate races with ShenandoahFreeSet::available()

Kelvin Nilsen kdnilsen at openjdk.org
Tue May 13 18:11:25 UTC 2025


On Fri, 9 May 2025 23:45:50 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

> 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).

This pull request has now been integrated.

Changeset: e7ce661a
Author:    Kelvin Nilsen <kdnilsen at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/e7ce661adb01fba4bb690d51cc2858c822008654
Stats:     97 lines in 10 files changed: 74 ins; 9 del; 14 mod

8356667: GenShen: Eliminate races with ShenandoahFreeSet::available()

Reviewed-by: wkemper

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

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


More information about the hotspot-gc-dev mailing list