RFR: 8369048: GenShen: Defer ShenFreeSet::available() during rebuild [v3]

Y. Srinivas Ramakrishna ysr at openjdk.org
Sat Nov 15 00:36:45 UTC 2025


On Thu, 13 Nov 2025 18:12:38 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

>> This code introduces a new rebuild-freeset lock for purposes of coordinating the freeset rebuild activities and queries as to memory available for allocation in the mutator partition.
>> 
>> This addresses a problem that results if available memory is probed while we are rebuilding the freeset.
>> 
>> Rather than using the existing global heap lock to synchronize these activities, a new more narrowly scoped lock is introduced.  This allows the available memory to be probed even when other activities hold the global heap lock for reasons other than rebuilding the freeset, such as when they are allocating memory.  It is known that the global heap lock is heavily contended for certain workloads, and using this new lock avoids adding to contention for the global heap lock.
>
> Kelvin Nilsen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 17 commits:
> 
>  - Merge remote-tracking branch 'jdk/master' into synchronize-available-with-rebuild
>  - update comment
>  - Add documentation for _rebuild_lock
>  - Hide rebuild_lock inside prepare_to_rebuild and finish_rebuild
>  - Rename rebuild_lock()
>  - Tighten up context for holding rebuild_lock
>  - Remove ShenandoahFreeSet::FreeSetUnderConstruction sentinel value
>  - Revert "revert introduction of RebuildLock"
>    
>    This reverts commit bec73da1dc169d391e9919203e5a406ea02a699c.
>  - Revert "available() returns previous value if called during freeset rebuild"
>    
>    This reverts commit 1a5e483a4abb04b6045175e8bd4b0c11fa68cb73.
>  - Revert "remove obsolete assertion"
>    
>    This reverts commit 717e7da17f03f1e52008d154fafcbbfc5f2bb20e.
>  - ... and 7 more: https://git.openjdk.org/jdk/compare/bfc048ab...8462a290

This looks good to me. Curious if any performance delta was noted in fresh measurements following this final shape of fix.

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

Marked as reviewed by ysr (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/27612#pullrequestreview-3467303404


More information about the hotspot-gc-dev mailing list