RFR: 8324649: Shenandoah: refactor implementation of free set [v4]

Kelvin Nilsen kdnilsen at openjdk.org
Wed Jan 31 00:28:07 UTC 2024


On Sun, 28 Jan 2024 23:11:43 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

>> Kelvin Nilsen has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Fix typo in comment
>>  - Remove unnecessary include
>
> src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp line 51:
> 
>> 49:     _region_size_bytes(ShenandoahHeapRegion::region_size_bytes())
>> 50: {
>> 51:   _membership = NEW_C_HEAP_ARRAY(ShenandoahFreeMemoryType, max_regions, mtGC);
> 
> So it looks like max_regions will cover the entire largest possible size of the heap (and all regions that can ever be in the heap).
> 
> In that case, I'd make the `_max` field `const`, and similarly the `_membership` array. By the way, I see a bunch of terms being interchangeably used here: sets, types, membership. I'd settle upon a single terminology that would cleanly work and keep the set of terms small.

Good points.  Declaring these as constants.  Replacing which_set with which_partition globally.

Changing ShenandoahFreeSetRegionType to ShenandoahFreeSetPartitionId.

Renaming function region_type_name() to partition_name()

Renaming in_free_set() to in_partition()

Renaming retire_within_free_set() to retire_within_partition()

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17561#discussion_r1472155032


More information about the hotspot-gc-dev mailing list