RFR: 8359105: RISC-V: No need for acquire fence in safepoint poll during JNI calls
Robbin Ehn
rehn at openjdk.org
Wed Jun 11 12:17:29 UTC 2025
On Tue, 10 Jun 2025 06:33:34 GMT, Anjian Wen <wenanjian at openjdk.org> wrote:
> backport of acquire fence removal in safepoint poll during JNI calls as aarch64[0]
>
> At least in jdk11, when comes to safepoint::end, it will invoke SafepointMechanism::disarm_local_poll to change the polling_word_offset, which may cause a race when thread come to visit polling_word_offset in native_trans state, so we used to use acquire fence.
>
> Since the disarm_local_poll has been removed from SafepointSynchronize::end, Thread disarm itself in
> JavaThread::check_special_condition_for_native_trans when trans from native. it seems that there is no need for acquire fence.
>
> [0] https://github.com/openjdk/jdk/pull/20420
Hey, sure.
The description says "backport of", as you are changing master I think that description is wrong.
The downcallLinker_riscv.cpp is the same case as the native transition.
So I don't see why you would keep that acquire ?
AFIACT no one should use acquire, thus this should then mean that we can remove "bool acquire" argument from safepoint_poll().
That arm still have acquire in their downlinker seems like an oversight?
8337657 only have one reviewer, I think it should have been cought there.
(please note https://wiki.openjdk.org/display/HotSpot/Pushing+a+HotSpot+change, two reviewers required)
@dchuyko can you open a new issue and look the acquire in downcall linker for aarch64 ?
Thanks, Robbin
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25709#issuecomment-2962456420
More information about the hotspot-dev
mailing list