RFR: 8295948: Support for Zicbop/prefetch instructions on RISC-V [v2]
Ludovic Henry
luhenry at openjdk.org
Wed Nov 2 13:34:27 UTC 2022
On Wed, 2 Nov 2022 09:00:24 GMT, Fei Yang <fyang at openjdk.org> wrote:
>> Ludovic Henry has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Remove uncessary cache line alignement
>
> src/hotspot/os_cpu/linux_riscv/prefetch_linux_riscv.inline.hpp line 36:
>
>> 34: (void (*)(const void*, intptr_t))StubRoutines::riscv::prefetch_r();
>> 35: if (interval >= 0 && stub != NULL) {
>> 36: stub(loc, interval);
>
> I am not sure if it really worth it to call a stub for read / write here. It looks to me not a big issue for the case the stub tries to catch and resolve. And I see aarch64 simply plant a 'prfm' instruction for prefetching [1]. I guess we might can do the same?
>
> [1] https://github.com/openjdk/jdk/blob/master/src/hotspot/os_cpu/linux_aarch64/prefetch_linux_aarch64.inline.hpp#L34
We would need to check for `UseZicbop` in any case; the access to a global variable is then required.
It would be the same issue as https://github.com/openjdk/jdk/pull/10884/files/e968f7164124dcf560807c9ff7765e6f82b64cdd#diff-e3c18b8b83898e82b5a3069319df6a47468e91cc2527bf065e704a685a20f26bR5196 without the stub.
I've to admit that the `interval` naming here is confusing since no implementation ever uses it as an interval but alway as an offset. Also, the callers assume it to be an offset, like `ContiguousSpace::prepare_for_compaction` for example.
If we are to simply ignore the interval parameter, then we can also remove all uses of `PrefetchCopyIntervalInBytes`, `PrefetchScanIntervalInBytes`,
-------------
PR: https://git.openjdk.org/jdk/pull/10884
More information about the hotspot-dev
mailing list