RFR: 8341544: Restore fence() in Mutex

Anton Artemov duke at openjdk.org
Thu May 15 11:47:31 UTC 2025


On Mon, 12 May 2025 07:31:14 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:

>> Added a fence in the mutex code in order to make the critical section provided by the mutex follow the roach-motel semantics. 
>> 
>> No significant performance impact observed in an extending testing.
>> 
>> Tested in tiers 1-3.
>
> src/hotspot/share/runtime/handshake.cpp line 259:
> 
>> 257:     if (UseSystemMemoryBarrier) {
>> 258:       SystemMemoryBarrier::emit();
>> 259:     } else {
> 
> I don't think this change should mess around with random handshaking code. This PR is concerned with fortifying the memory ordering of Mutex, which is orthogonal.

I agree with this point, addressed in the latest commit.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25033#discussion_r2084093316


More information about the hotspot-runtime-dev mailing list