RFR: 8369048: GenShen: Defer ShenFreeSet::available() during rebuild

Kelvin Nilsen kdnilsen at openjdk.org
Tue Nov 11 22:44:04 UTC 2025


On Fri, 31 Oct 2025 00:23:18 GMT, Y. Srinivas Ramakrishna <ysr 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.
>
> src/hotspot/share/gc/shenandoah/shenandoahFreeSet.hpp line 323:
> 
>> 321:   ShenandoahRegionPartitions _partitions;
>> 322: 
>> 323:   // This locks the rebuild process (in combination with the global heap lock)
> 
> Explain the role of this & the global heap lock vis-a-vis the rebuild process.
> 
> Also may be call it `_rebuild_lock`, rather than just `_lock`.

Am changing the name.  I will add discussion of the rank ordering of locks here as well.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27612#discussion_r2516042979


More information about the hotspot-gc-dev mailing list