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

Kelvin Nilsen kdnilsen at openjdk.org
Sat Feb 3 03:02:06 UTC 2024


On Thu, 1 Feb 2024 06:37:54 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 132:
> 
>> 130:     assert (which_partition > NotFree && which_partition < NumPartitions, "selected free set must be valid");
>> 131:     return _used[which_partition];
>> 132:   }
> 
> The assertions here indicate to me that it is likely my earlier suspicion that many of these fields are not needed for NotFree is true. (See my earlier comment about many of these fields for NotFree.) I feel it may be best to let the enum type system enforce this, rather than use these assertions. NotFree then becomes a sentinel value that is not part of the legal index set that can be passed in here.
> 
> May be that can be done later, as I realize the type contagion might necessitate more changes (although I think it will conceptually simplify this) by maintaining the disctinction between the tags in the _membership[] array, and the types used for the so-called free partitions.

Thanks for sorting through this.  You are right.  I do not maintain used, capacity for NotFree regions.  I've made adjustments to the enum declaration and to the assertions to make this more clear.  My efforts to do so may have increased the "dissonance" with mathematical definition of partition.  Please let me know if you see a better way to approach this.

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

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


More information about the hotspot-gc-dev mailing list