RFR: 8367731: G1: Make G1CollectionSet manage the young gen cset group

Thomas Schatzl tschatzl at openjdk.org
Mon Sep 22 10:14:20 UTC 2025


On Fri, 19 Sep 2025 07:33:54 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> Hi all,
>> 
>>   please review this change that lets the collection set manage the young cset candidate group directly. Currently everywhere the collection set (not "containing" the young cset candidate group) is used, we immediately do the same thing for the young gen candidate group in the same place.
>> 
>> This makes it kind of natural to put together (and the `G1CollectionSet` already manages adding new regions to the young gen cset group anyway, so that split in responsibility is questionable anyway).
>> 
>> Testing: gha
>> 
>> Thanks,
>>   Thomas
>
> src/hotspot/share/gc/g1/g1CollectionSet.cpp line 103:
> 
>> 101: 
>> 102: void G1CollectionSet::abandon() {
>> 103:   _g1h->young_regions_cset_group()->clear(true /* uninstall_cset_group */);
> 
> It's a bit odd that `CollectionSet` doesn't have direct access to `cset_group` and have to go through heap.

I thought back and forth making `G1CollectionSet` the owner of the `young_regions_cset_group` (i.e. a member of it) and found both advantages and disadvantages for that.
Unless the second reviewer thinks it is better to do that, I'll keep it for now.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27312#discussion_r2367429169


More information about the hotspot-gc-dev mailing list