RFR: JDK-8262068: Improve G1 Full GC by skipping compaction for regions with high survival ratio [v11]

Hamlin Li mli at openjdk.java.net
Fri Mar 26 09:50:29 UTC 2021


On Fri, 26 Mar 2021 09:17:05 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

>> Hamlin Li has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains seven commits:
>> 
>>  - Merge branch 'master' into g1-full-gc-optimization-00
>>  - reuse the "pin" mechanism (G1FullCollector._region_attr_table) to skip region compaction;
>>    deal with last-ditch full gc;
>>  - Merge branch 'master' into g1-full-gc-optimization-00
>>  - fix bot crash.
>>  - fix crash in G1CalculatePointersClosure::prepare_for_skipping_compaction when klass of dead objects is unloaded;
>>    other misc improvements.
>>  - reuse vm option MarkSweepDeadRatio; reuse G1RegionMarkStatsCache class; fix regression in Mark phase by inlining live words collection into mark_object()
>>  - JDK-8262068: Improve G1 Full GC by skipping compaction for regions with high survival ratio
>
> src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp line 83:
> 
>> 81:   // Reset data structures not valid after Full GC.
>> 82:   reset_region_metadata(hr);
>> 83:   _collector->update_attribute_table(hr, force_pinned);
> 
> @tschatzl, this call was here since before (but without the force part). Why is it needed? The call to `update_attribute_table()` will return straight away if the region has been free and to me it looks like that is the only change that can have occurred at this point. If it is not needed for other reasons, instead of adding the `force_pinned` part we could just add a `set_pinned()` helper to the `G1FullCollector` to make it more clear what is happening.

in G1ResetPinnedClosure,  we need to skip freed humongous regions which depends on the info in attribute table. But if we don't update the corresponding table entry for freed humongous regions, these regions will invoke reset_pinned_after_full_gc(), seems it's wrong.

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

PR: https://git.openjdk.java.net/jdk/pull/2760



More information about the hotspot-gc-dev mailing list