RFR: 8276670: G1: Move and rename G1CardSetFreePool and related classes [v6]

Thomas Schatzl tschatzl at openjdk.java.net
Mon Nov 22 09:55:14 UTC 2021


On Fri, 19 Nov 2021 04:49:59 GMT, Hamlin Li <mli at openjdk.org> wrote:

>> Currently, only the card sets (remembered sets) use G1CardSetFreePool to give back memory to OS.
>> 
>> After JDK-8254739, this memory reclaiming mechanism could be reused by evacuation failure too. This is a preparation change to allow reuse of this code.
>> 
>> I plan to do this in about 3 steps to smooth the review process:
>>   1. move G1CardSetFreePool and related classes to new file, rename these classes
>>   2. refactor these classes to support freeing other freelist
>>   3. some necessary cleanup
>> 
>> This is to simply move and rename G1CardSetFreePool and related classes, as G1CardSetFreePool and related classes are going to be reused outside of the remembered set, they should be factored out and renamed.
>> Rename from G1CardSetXxx -> G1BufferListXxx.
>
> Hamlin Li has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 11 commits:
> 
>  - Merge with master
>  - Rename card set to segmented array
>  - Rename from G1BufferListXxx to G1SegmentedArrayXxx
>  - Fix typo
>  - Merge branch 'master' into rename-move-G1CardSetFreePool-out
>  - Fix typos
>  - Fix gtest tests
>  - Fix missing in test
>  - Fix missing files
>  - move g1CardSetFreeMemoryTask.*
>  - ... and 1 more: https://git.openjdk.java.net/jdk/compare/2f0bde1a...7cfe01fb

Changes requested by tschatzl (Reviewer).

src/hotspot/share/gc/g1/g1CardSetMemory.cpp line 28:

> 26: 
> 27: #include "gc/g1/g1CardSetMemory.inline.hpp"
> 28: #include "gc/g1/g1CardSetContainers.inline.hpp"

Include order, must be sorted alphabetically

src/hotspot/share/gc/g1/g1CardSetMemory.hpp line 28:

> 26: #define SHARE_GC_G1_G1CARDSETMEMORY_HPP
> 27: 
> 28: #include "gc/g1/g1SegmentedArrayFreePool.hpp"

Include order, must be sorted alphabetically

src/hotspot/share/gc/g1/g1CollectedHeap.cpp line 36:

> 34: #include "gc/g1/g1BarrierSet.hpp"
> 35: #include "gc/g1/g1BatchedTask.hpp"
> 36: #include "gc/g1/g1SegmentedArrayFreeMemoryTask.hpp"

Include order, must be sorted alphabetically

src/hotspot/share/gc/g1/g1CollectedHeap.hpp line 30:

> 28: #include "gc/g1/g1BarrierSet.hpp"
> 29: #include "gc/g1/g1BiasedArray.hpp"
> 30: #include "gc/g1/g1SegmentedArrayFreeMemoryTask.hpp"

Include order, must be sorted alphabetically

src/hotspot/share/gc/g1/g1SegmentedArrayFreeMemoryTask.cpp line 26:

> 24: 
> 25: #include "precompiled.hpp"
> 26: #include "gc/g1/g1SegmentedArrayFreeMemoryTask.hpp"

Include order, must be sorted alphabetically

src/hotspot/share/gc/g1/g1SegmentedArrayFreeMemoryTask.cpp line 42:

> 40: 
> 41: bool G1SegmentedArrayFreeMemoryTask::deadline_exceeded(jlong deadline) {
> 42:   return os::elapsed_counter() >= deadline;

The include for `os` seems to be missing (pre-existing)

src/hotspot/share/gc/g1/g1SegmentedArrayFreeMemoryTask.hpp line 29:

> 27: 
> 28: #include "gc/g1/g1ServiceThread.hpp"
> 29: #include "gc/g1/g1SegmentedArrayFreePool.hpp"

Include order, must be sorted alphabetically

src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.hpp line 32:

> 30: #include "utilities/growableArray.hpp"
> 31: 
> 32: // Statistics for a fixed set of buffer lists. Contains the number of buffers and memory

s/fixed set of buffer lists/segmented array/ 
Contains the number of segments and memory.... Afair that's part of the other renaming change coming up.

src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.hpp line 39:

> 37: 
> 38:   size_t _num_mem_sizes[G1CardSetConfiguration::num_mem_object_types()];
> 39:   size_t _num_buffers[G1CardSetConfiguration::num_mem_object_types()];

The renaming of `_num_buffers` to `_num_segments` should be done in the other renaming change (which is fine).

src/hotspot/share/gc/g1/g1YoungCollector.hpp line 36:

> 34: class G1Allocator;
> 35: class G1BatchedTask;
> 36: class G1SegmentedArrayMemoryStats;

Must be sorted alphabetically.

test/hotspot/gtest/gc/g1/test_g1CardSet.cpp line 25:

> 23: 
> 24: #include "precompiled.hpp"
> 25: #include "gc/g1/g1SegmentedArrayFreePool.hpp"

Must be sorted alphabetically.

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

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



More information about the hotspot-gc-dev mailing list