RFR: 8280087: G1: Handle out-of-mark stack situations during reference processing more gracefully [v5]
Albert Mingkun Yang
ayang at openjdk.org
Thu Dec 14 15:20:47 UTC 2023
On Thu, 7 Dec 2023 20:03:36 GMT, Ivan Walulya <iwalulya at openjdk.org> wrote:
>> Hi all,
>>
>> Please review this change to modify how we grow the global marking stack used by Concurrent Marking. This patch allows for growing the marking stack without the need to copy over elements. Consequently, we can grow the marking stack even during the reference processing phase without the need to restart the marking cycle.
>>
>> This mainly addresses the issue where object marking work created during reference processing may overflow the global marking stack. Currently G1 just bails out with a fatal error as expanding the marking stack would require a restart which is not valid during the reference processing phase.
>>
>> We have decided to maintain the restart concurrent marking when the global mark stack overflows during the marking phase of the concurrent cycle as this offers better memory utilisation.
>>
>> Testing: Tier 1-5.
>
> Ivan Walulya has updated the pull request incrementally with one additional commit since the last revision:
>
> Albert Review
src/hotspot/share/gc/g1/g1ConcurrentMark.cpp line 159:
> 157: if (!reserve(new_capacity)) {
> 158: return nullptr;
> 159: }
Can this logic reuse `expand()`? It would be good if all code using growing-factor is centralized.
src/hotspot/share/gc/g1/g1ConcurrentMark.hpp line 143:
> 141: // need to copy existing items. The fundamental approach involves organizing the array into chunks,
> 142: // essentially creating an "array of arrays"; referred to as buckets in this implementation. To
> 143: // facilitate efficient indexing, the size of the first chunk is set to a power of 2. This choice
I believe the "Chunk" On L136 mean sth diff as the one here -- here, you are probably referring to a "bucket".
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16979#discussion_r1426856226
PR Review Comment: https://git.openjdk.org/jdk/pull/16979#discussion_r1426861106
More information about the hotspot-gc-dev
mailing list