RFR: 8361952: Installation of MethodData::extra_data_lock() misses synchronization on reader side

Thomas Schatzl tschatzl at openjdk.org
Fri Jul 11 12:18:38 UTC 2025


On Fri, 11 Jul 2025 10:43:21 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> Looks reasonable.
> 
> Two nits:
> 
>     * This is not technically double-checked locking, this is just an atomic installation. So the RFE synopsis is not that accurate.

Fixed.

> 
>     * Maybe `Atomic::cmpxchg` should use a more relaxed memory ordering as well, to micro-optimize and offset the costs of now-proper acquire a bit. There is no need for default `memory_order_conservative` here. I think `memory_order_seq_cst` would do: gives acquire of `old` and release of new in the same package.

I will leave that suggestion to another RFE.

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

PR Comment: https://git.openjdk.org/jdk/pull/26262#issuecomment-3062079334


More information about the hotspot-dev mailing list