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

Hamlin Li mli at openjdk.java.net
Sat Oct 9 03:22:09 UTC 2021


On Fri, 8 Oct 2021 09:37:42 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

> > > 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...

Agree. I've filed https://bugs.openjdk.java.net/browse/JDK-8274987 to track the enhancement, 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