RFR: 8370807: G1: Improve region attribute table method naming
Thomas Schatzl
tschatzl at openjdk.org
Wed Oct 29 11:42:57 UTC 2025
On Wed, 29 Oct 2025 11:32:06 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
>> The `set_in_old` call is the giveaway - in the region attribute table you only set a region to "Old" if it is
>>
>> static const region_type_t Old = 1; // The region is in the collection set and an old region.
>>
>> Old regions not in the collection set are just `NotInCset`.
>
> The "Young" and "NewSurvivor" do not have the `collection_set` tagging because they are always in the collection set (i.e. it's obvious).
>
> I thought it would be good to make it clear in the name that for old regions, we only add (old) regions that are part of the collection set.
The attribute table is an accelerator table - it only mirrors information from elsewhere used during GC. So the given region is already(*) in the collection set, but we can't check easily.
(*) Formally, from the code flow it isn't yet - the cardset group this region is contained in (which determines whether the related regions are in) will also be added during the `G1CollectionSet::add_group_to_collection_set()` call. This would just require some reordering of the calls, but logically it already is. If you really want I can do that in this change too.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28038#discussion_r2472673906
More information about the hotspot-gc-dev
mailing list