RFR: 8264026: Remove dependency between free collection set and eagerly reclaim humongous object tasks

Thomas Schatzl tschatzl at openjdk.java.net
Wed Mar 24 08:44:39 UTC 2021


On Tue, 23 Mar 2021 20:49:18 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

>> Hi,
>> 
>>   I am currently working on [JDK-8214237](https://bugs.openjdk.java.net/browse/JDK-8214237) to merge some phases from `G1CollectedHeap::post_evacuate_collection_set()` into less parallel phases.
>> 
>> While investigating dependencies I found that `free_collection_set` and `eagerly_reclaim_humongous_regions` have a dependency: `free_collection_set` rebuilds the free list at the end (in another parallel phase :( ), and `eagerly_reclaim_humongous_regions` adds to those regions.
>> 
>> This dependency is unnecessary: just move the rebuilding of the free list after eagerly reclaiming humongous regions, and neither needs to care about updating the free regions list. 
>> 
>> Testing: hs-tier1-5
>
> src/hotspot/share/gc/g1/g1CollectedHeap.cpp line 4488:
> 
>> 4486: void G1CollectedHeap::rebuild_free_region_list() {
>> 4487:   Ticks start = Ticks::now();
>> 4488:   _hrm.rebuild_free_list(workers());
> 
> The first thing done in`rebuild_free_list()` is to drop the current free_list to rebuild if from scratch. So we should now be able to remove the call `prepend_to_freelist(&local_cleanup_list)` in `eagerly_reclaim_humongous_regions()`. Doing so the `local_cleanup_list` is only used for printing, and we should probably investigate if this can be done differently.

There is (JDK-8264027)[https://bugs.openjdk.java.net/browse/JDK-8264027] filed for this. For now I was planning to keep this gathering of regions into the list but just factor out the printing code (as it's copy&pasted a bit), but we can certainly talk about more invasive measures.

The only way I see for now is that instead of gathering the elements in the list and printing in one go is printing immediately if we keep this functionality...

Thanks for your review.

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

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



More information about the hotspot-gc-dev mailing list