RFR: 8343541: C1: Plain memory accesses are emitted with membars with +AlwaysAtomicAccesses [v2]

David Holmes dholmes at openjdk.org
Tue Nov 19 07:24:45 UTC 2024


On Mon, 18 Nov 2024 09:36:51 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>>> It is a bit sad that we call `volatile_field_*` when we really mean atomic. But renaming that would lead to much deeper changes. So I am okay with doing just this, thanks.
>> 
>> I'll fix it, it is not too deep, and they are only used by barrierSetC1.cpp
>
>> > It is a bit sad that we call `volatile_field_*` when we really mean atomic. But renaming that would lead to much deeper changes. So I am okay with doing just this, thanks.
>> 
>> I'll fix it, it is not too deep, and they are only used by barrierSetC1.cpp
> 
> No need. If we go down that road, we also want to rename `lir_move_volatile` and all that jazz, which would probably entail a few rounds of careful looking. Submit a follow-up issue for it instead.

I guess @shipilev is the authorative source here, but my reading of JDK-8033380 is that it intended for all long/double accesses to be treated just like volatile double/long accesses - and hence wanted atomicity and membars.

That said here we are 10 years down the track and the JMM update never eventuated. Is this code even still warranted? Does this mean the JMM update efforts are reviving?

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

PR Comment: https://git.openjdk.org/jdk/pull/22191#issuecomment-2484879745


More information about the hotspot-dev mailing list