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

Kelvin Nilsen kdnilsen at openjdk.org
Sat Feb 3 14:41:04 UTC 2024


On Sat, 3 Feb 2024 01:44:29 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

>> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Rename and comments for _capacity_of and _used_by
>
> src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp line 766:
> 
>> 764: 
>> 765:   // This places regions that have alloc_capacity into the mutator partition.
>> 766:   find_regions_with_alloc_capacity(cset_regions);
> 
> In conjunction with `clear()` above, it looks like we are doing two walks of the _membership array in the implementation as a result of this. Why not just have a single API from `ShenandoahRegionPartitions` that walks over the regions and sorts them into the NotFree or the Mutator partition in one go, rather than one walk to clear and another to then move some into Mutator?
> 
> Also the method should probably be renamed to `move_alloc_regions_to_mutator()`, which should be moved into `ShenandoahRegionPartitions` class as a public API for this class `ShenandoahFreeSet` to call.

We walk twice, first to figure out how much memory is available, and how many regions are completely empty.  This information eventually feeds into GenShen's transfer of regions between young-gen and old-gen.  There is less motivation for that distinction in single-generation Shenandoah because we do not need to make these informed transfers.

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

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


More information about the shenandoah-dev mailing list