RFR: 8341544: Restore fence() in Mutex

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


On Tue, 13 May 2025 10:20:46 GMT, David Holmes <dholmes at openjdk.org> wrote:

> As per JBS comment I still think we only need to add the missing storeload part of the full-fence, to complement the existing barriers the platform sync primitives provide.

@dholmes-ora Each and every implementation of storeload() is either calling fence() or is calling the same method as fence(), what exactly do you mean by the missing part?

> src/hotspot/share/runtime/mutex.hpp line 218:
> 
>> 216:   //  section provided by the mutex follow the Roach-Motel semantics. Having a fence does
>> 217:   //  not have any significant impact on peformance, as this is an internal VM
>> 218:   //  mutex and is generally not in hot code parts.
> 
> Suggestion:
> 
>   //  mutex and is generally not in hot code paths.

Addressed in the latest commit.

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

PR Comment: https://git.openjdk.org/jdk/pull/25033#issuecomment-2876359379
PR Review Comment: https://git.openjdk.org/jdk/pull/25033#discussion_r2084093703


More information about the hotspot-runtime-dev mailing list