RFR: 8339771: RISC-V: Reduce icache flushes [v2]
Fei Yang
fyang at openjdk.org
Wed Sep 18 11:50:09 UTC 2024
On Wed, 18 Sep 2024 08:30:52 GMT, Robbin Ehn <rehn at openjdk.org> wrote:
>> src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 3059:
>>
>>> 3057: void MacroAssembler::cmodx_fence() {
>>> 3058: BLOCK_COMMENT("cmodx fence");
>>> 3059: if (VM_Version::supports_fencei_barrier()) {
>>
>> Seems more reasonable to turn this into an assertion? `assert(VM_Version::supports_fencei_barrier(), "must be");`
>
> The cmodx_fence() is called after a safepoint or thread local handshake.
> Even if it costs tens? of cycles it is very little compared to hitting the poll, potentially comming from signal handler, hence therefore I kept it always 'on'.
>
> But we are only guaranteed to have fence.i when running on Linux, this is code is not specific to linux.
> I.e. MASM should be OS independent. As we already check this during boot in Linux specific code there is no way that assert can happen on Linux.
>
> But maybe our JDK implementation should require fence.i ?
> If we do then doing the assert make more sense, yes.
Ah, I see. Make sense.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20913#discussion_r1764909465
More information about the hotspot-dev
mailing list