RFR: 8302215: G1: Last-ditch Full GC should do serial compaction for tail regions in per thread compaction points. [v4]
Thomas Schatzl
tschatzl at openjdk.org
Fri Feb 17 08:58:18 UTC 2023
On Thu, 16 Feb 2023 18:08:00 GMT, Ivan Walulya <iwalulya at openjdk.org> wrote:
>> Hi all,
>>
>> Please review this change to call `G1FullCollector::phase2c_prepare_serial_compaction` when `do_maximal_compaction`. For maximum compaction, we re-prepare all objects in the "tail" regions of the per thread compaction points.
>>
>> Testing: Tier 1-3.
>>
>> Thanks
>
> Ivan Walulya has updated the pull request incrementally with one additional commit since the last revision:
>
> combine prepare with adding regions to compaction point
Changes requested by tschatzl (Reviewer).
src/hotspot/share/gc/g1/g1FullCollector.cpp line 372:
> 370: }
> 371:
> 372: for (uint i = 0; i < workers(); i++) {
This is something I'd probably try how it looks - as the method is already somewhat large and consists of three relatively independent parts, maybe it is useful to change it to something like
uint lowest_current = find_lowest_worker_cp_region();
remove_cp_regions_above(lowest_current);
initialize_serial_compaction_point();
Probably these names are bad, and it's a bad idea alltogether and just increases noise, so ignore as you like. Maybe it's only the last part that is already large enough to warrant a helper method.
(Also my names for the helpers are somewhat bad too so potentially this is a reason to ignore this too ;) )
src/hotspot/share/gc/g1/g1FullCollector.cpp line 382:
> 380: HeapWord* dense_prefix_top = nullptr;
> 381: for (uint i = lowest_current; i < _heap->max_reserved_regions(); i++) {
> 382: if (_region_attr_table.is_free(i) || _region_attr_table.is_compacting(i)) {
Suggestion:
if (is_compaction_target(i)) {
This predicate is already available.
-------------
PR: https://git.openjdk.org/jdk/pull/12529
More information about the hotspot-gc-dev
mailing list