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:21:14 UTC 2025
backport of acquire fence removal in safepoint poll during JNI calls as aarch64
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.
-------------
Commit messages:
- RISC-V: No need for acquire fence in safepoint poll during JNI calls
Changes: https://git.openjdk.org/jdk/pull/25709/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25709&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8359105
Stats: 18 lines in 2 files changed: 0 ins; 14 del; 4 mod
Patch: https://git.openjdk.org/jdk/pull/25709.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/25709/head:pull/25709
PR: https://git.openjdk.org/jdk/pull/25709
More information about the hotspot-dev
mailing list