RFR: 8307106: Allow concurrent GCs to walk CLDG without ClassLoaderDataGraph_lock

David Holmes dholmes at openjdk.org
Wed May 3 07:20:20 UTC 2023


On Tue, 2 May 2023 12:50:01 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:

>> src/hotspot/share/classfile/classLoaderDataGraph.cpp line 531:
>> 
>>> 529:       assert(dead == _head, "sanity check");
>>> 530:       // The GC might be walking this concurrently
>>> 531:       Atomic::store(&_head, data);
>> 
>> If you are using `load_acquire` then surely this must be a `release-store` as they need to be paired.
>
> The load_acquire synchronizes with release_store on insertions. This relaxed unlinking store, doesn't publish anything new that the load_acquire is interested in. It rolls back the head to a CLD that was installed at some earlier point with release_store, meaning it has already been published safely before.

Thanks for clarifying

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13718#discussion_r1183318725


More information about the hotspot-runtime-dev mailing list