RFR: 8273626: G1: Factor out concurrent segmented array from G1CardSetAllocator [v3]

Hamlin Li mli at openjdk.java.net
Sat Oct 9 03:35:14 UTC 2021


On Fri, 8 Oct 2021 07:59:03 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> Hamlin Li has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
>> 
>>  - Merge branch 'openjdk:master' into generalize-g1CardSetBuffer-and-Allocator
>>  - Rename Xxx to G1Xxx
>>  - Clean code
>>  - Fix wrong length() in SegmentedArrayBuffer, cause it might grow more than _elem_nums
>>  - Initial commit
>
> src/hotspot/share/gc/g1/g1SegmentedArray.hpp line 146:
> 
>> 144: 
>> 145:   G1SegmentedArrayAllocOptions(uint elem_size, uint initial_num_elems = MinimumBufferSize,
>> 146:                                uint max_num_elems = MaximumBufferSize, uint alignment = BufferAlignment) :
> 
> Now that this class is going to be used in multiple contexts, I would prefer if the defaults (and default values) would be removed and added at the place of use.
> Just add an empty constructor that sets this to bogus values (zeros probably), and check that these are set in eg. `next_num_elems`.
> 
> Alternatively delay this suggested change to the next and change back the value of `BufferAlignment` which I'd actually prefer.

I've filed https://bugs.openjdk.java.net/browse/JDK-8274988 to track the issue, will work on it soon after we finish refactoring.

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

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



More information about the hotspot-gc-dev mailing list