RFR: 8365034: G1: Remove num_groups_selected in G1CollectionSet::select_candidates_from_optional_groups as it is unnecessary [v3]

Ivan Walulya iwalulya at openjdk.org
Fri Aug 22 15:41:55 UTC 2025


On Thu, 21 Aug 2025 15:19:11 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> Hi all,
>> 
>>   please review this removal of the local `num_selected_regions` from `G1CollectionSet::select_candidates_from_optional_groups()` - the same information is maintained within the local `selected_groups` list.
>> 
>> Testing: gha
>> 
>> Thanks,
>>   Thomas
>
> Thomas Schatzl has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 12 commits:
> 
>  - Merge branch 'master' into 8365034-remove-unnecessary-num_selected_regions
>  - * ayang review
>  - Merge branch '8364934-g1collectionset-renaming' into 8365034-remove-unnecessary-num_selected_regions
>  - Merge branch 'master' into 8364934-g1collectionset-renaming
>  - Merge branch 'master' into 8364934-g1collectionset-renaming
>  - * one more renaming: prepare_groups_for_scan() -> prepare_for_scan()
>  - Merge branch '8364925-improve-program-flow-inc-cset' into 8364934-g1collectionset-renaming
>  - * ayang review
>  - 8365034
>    
>    Hi all,
>    
>      please review this removal of the local `num_selected_regions` from `G1CollectionSet::select_candidates_from_optional_groups()` - the same information is maintained within the local `selected_groups` list.
>    
>    Testing: gha
>    
>    Thanks,
>      Thomas
>  - 8364934
>    
>    Hi all,
>    
>      please review this renaming of various members of `G1CollectionSet` to
>    
>    - use the same prefixes
>    - remove unnecessary prefixes (`collection_set`)
>    - fix some documentation
>    
>    Testing: gha
>    
>    Thanks,
>      THoams
>  - ... and 2 more: https://git.openjdk.org/jdk/compare/fb651fd6...131c4d63

Nits that will be cleared with merging.

src/hotspot/share/gc/g1/g1CollectionSet.cpp line 350:

> 348:   return static_cast<int>(a-b);
> 349: }
> 350: 

Should not be in this PR

src/hotspot/share/gc/g1/g1CollectionSet.cpp line 691:

> 689: 
> 690:   stop_incremental_building();
> 691:   QuickSort::sort(_regions, _regions_cur_length, compare_region_idx);

Should not be in this PR

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

Marked as reviewed by iwalulya (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/26674#pullrequestreview-3144978340
PR Review Comment: https://git.openjdk.org/jdk/pull/26674#discussion_r2294072917
PR Review Comment: https://git.openjdk.org/jdk/pull/26674#discussion_r2294072357


More information about the hotspot-gc-dev mailing list