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

Anjian Wen wenanjian at openjdk.org
Wed Jun 11 09:42:27 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 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

@robehn Hi, Can you help to review the patch?

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

PR Comment: https://git.openjdk.org/jdk/pull/25709#issuecomment-2961953614


More information about the hotspot-dev mailing list