RFR: 8308881: Strong CLD oop handle roots are demoted to non-roots concurrently [v2]

Axel Boldt-Christmas aboldtch at openjdk.org
Fri May 26 13:23:03 UTC 2023


On Fri, 26 May 2023 12:47:04 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:

>> It is illegal to remove strong roots concurrently without clearing them first. A SATB collector with concurrent root scanning assumes that when strong roots disappear from the object graph, they are cleared first, which makes SATB notice the root. All global strong roots do this. Except CLD strong roots, which are turned into non-roots by decrementing the keep_alive counter to 0, when bootstrapping weak hidden class CLDs. This is not valid behaviour. This patch tries to treat these oops like we do any other global strong handles that are unlinked from the system: clear them when they stop being strong roots.
>
> Erik Österlund has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove null store and improve comments

Is there any issue with memory order access here?
>From my understanding this works because a GC which starts before `demote_strong_roots` has the property if it observers `_keep_alive == 0` then in must have observed `demote_strong_roots` (either root throughout or it observed the transition through barriers). And if a GC starts after `demote_strong_roots` it must never observe `_keep_alive != 0`.

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

PR Comment: https://git.openjdk.org/jdk/pull/14154#issuecomment-1564385165


More information about the hotspot-gc-dev mailing list