RFR: 8359105: RISC-V: No need for acquire fence in safepoint poll during JNI calls [v2]

Feilong Jiang fjiang at openjdk.org
Sat Jun 14 03:30:32 UTC 2025


On Thu, 12 Jun 2025 03:22:10 GMT, Anjian Wen <wenanjian at openjdk.org> wrote:

>> Acquire fence removal in safepoint_poll
>> 
>> 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 in safepoint_poll.
>> 
>> [0] https://github.com/openjdk/jdk/pull/20420
>
> Anjian Wen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   RISC-V: delete the acquire argument in safepoint_poll since there is no use

Looks fine. Thanks!

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

Marked as reviewed by fjiang (Committer).

PR Review: https://git.openjdk.org/jdk/pull/25709#pullrequestreview-2927057124


More information about the hotspot-dev mailing list