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

Hamlin Li mli at openjdk.java.net
Tue Oct 19 12:28:03 UTC 2021


On Fri, 8 Oct 2021 09:37:42 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
>
> Some additional note:
>  
>> > Current(original) implementation just drop the newly allocated G1SegmentedArrayBuffer if current thread fails, seems it's fine as the race should be rare, should we add the faield one to free list? seems adding to freelist will bring some benefit.
>>
>>Yes, that's also what `G1CardSetAllocator` does. At least there, the race isn't that rare.
> 
> You need to consider that as soon there are (real, not just faked ones) evacuation failures, all subsequent allocations of potentially all threads will fail. The segmented array somewhat deals with that by increasing the buffer size, and potentially you are not always failing in the same region...
> 
> Thanks,
>   Thomas

Thanks @tschatzl @albertnetymk for your reviews.

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

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



More information about the hotspot-gc-dev mailing list