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

Kelvin Nilsen kdnilsen at openjdk.org
Wed Feb 7 18:48:00 UTC 2024


On Thu, 1 Feb 2024 05:51:14 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.hpp line 74:
> 
>> 72:   // and _used[p], even though the region may have been removed from the free set.
>> 73:   size_t _capacity[NumPartitions];
>> 74:   size_t _used[NumPartitions];
> 
> In light of your earlier documentation of leftmost/righmost/empty/available etc. then, would it be fair to say that the following statement is always true:
> 
> for p = NotFree:
> 1. leftmosts[p] = leftmosts_empty[p] = _max
> 2. rightmosts_empty[p] = rightmosts_empty[p] = 0
> 3. capacity[p] = used[p] = region_size
> 
> Are the "NotFree" entries for these arrays ever used?
> 
> If not, is there any point in keeping them in a product build? Is there any point in keeping them in a non-product build? Does it have some other role that makes it important to keep it, anyway?

In most recent change, I shrunk the sizes of the arrays to not include an entry for NotFree.  We only maintain entries for Mutator and Collector.

> src/hotspot/share/gc/shenandoah/shenandoahFreeSet.hpp line 75:
> 
>> 73:   size_t _capacity[NumPartitions];
>> 74:   size_t _used[NumPartitions];
>> 75:   size_t _region_counts[NumPartitions];
> 
> If tracked, is this an invariant of these fields?
> 
> - region_counts[NotFree] == _max - (region_counts[Mutator] + region_counts[Collector])
> 
> (This would also make the region_counts[NotFree] unnecessary? See my previous comment.)

This is not tracked, and no longer relevant because I removed region_counts[NotFree].

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

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


More information about the shenandoah-dev mailing list