RFR: 8321619: Generational ZGC: ZColorStoreGoodOopClosure is only valid for young objects [v2]
Stefan Karlsson
stefank at openjdk.org
Tue Dec 19 09:13:58 UTC 2023
On Tue, 19 Dec 2023 09:11:16 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:
>> When cloning object arrays, we should do something more similar to arraycopy. The intrinsics for C2 already do that, but there are colder paths where the runtime version of cloning is used, and objects being cloned can potentially end up in the old generation. This could hypothetically be a problem if the source object is being concurrently modified by an external thread, storing store good pointers into its elements. Then, the destination array will look like it doesn't need any store barriers, while in fact no entries have been inserted to the remembered set.
>>
>> This patch modifies cold object array cloning to be done more like array copy and relaxes the related assert for primitive arrays, which is what triggered the assertion that opened this investigation.
>>
>> I have tested generational ZGC tier 1-7, general testing tier 1-5, and confirmed the individual test that triggered the assert triggers without this fix and doesn't trigger with this fix.
>
> Erik Österlund has updated the pull request incrementally with one additional commit since the last revision:
>
> StefanK comments
Looks good!
-------------
Marked as reviewed by stefank (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/17141#pullrequestreview-1788416025
More information about the hotspot-gc-dev
mailing list