RFR: 8321619: Generational ZGC: ZColorStoreGoodOopClosure is only valid for young objects [v2]
Erik Österlund
eosterlund at openjdk.org
Tue Dec 19 09:13:57 UTC 2023
> 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
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/17141/files
- new: https://git.openjdk.org/jdk/pull/17141/files/aa9e67d5..e43c87c8
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=17141&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=17141&range=00-01
Stats: 7 lines in 3 files changed: 5 ins; 2 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/17141.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/17141/head:pull/17141
PR: https://git.openjdk.org/jdk/pull/17141
More information about the hotspot-gc-dev
mailing list