RFR: 8310949: RISC-V: Initialize UseUnalignedAccesses [v5]
Ludovic Henry
luhenry at openjdk.org
Thu Jul 6 15:39:59 UTC 2023
On Thu, 29 Jun 2023 05:49:24 GMT, Vladimir Kempik <vkempik at openjdk.org> wrote:
>>> > One case to consider: lets say I have a system with X big cores ( which support MISALIGNED_FAST) and X small cores ( with MISALIGNED_EMU)
>>> > if I run some java workload on all cores, what should hw_prober return ? obvious result here is to use +AvoidUnallignedAccesses.
>>> > If I run same java workload but use taskset to run it only on big cores, how will jdk's hw_prober code work ? should it work properly and disable AvoidUnallignedAccesses or it's too much and one need to manually set -XX:-AvoidUnallignedAccesses ?
>>>
>>> FYI: The only way today using hwprobe in example above is to query each cpu individually to find the cpu set that have fast and the cpu set have emulated. (or vector or any other extension which may differ) I have proposed that hwprobe should be able to also return a cpu set for some set of features. To either inform user of what affinity they should use, or if we want change the affinity of the VM automagically.
>>
>> I think Robbin brought this up at some meeting type thing, but IMO that's a pretty reasonable ask. We hadn't thought of it when writing the syscall, but we've got some flags for extensibility so I think we could make it work.
>>
>> Another option might be to tie this to some hueristics in userspace, maybe probing along the CPU topology or something. There's been some vague discussions about having a hwprobe userspace library to handle things like bit->string mappings, maybe we should just have it do this too?
>
> Hello @palmer-dabbelt, I meant I don't know how this thing should work "properly" when we have cpus with different capabilities (regarding misaligned access) and affinity manually set to misaligned_fast cores.
@VladimirKempik the `riscv_hwprobe` is going to return the intersection of the features supported by all cores. In the case of a big.LITTLE set of cores, if the LITTLE cores don't support fast unaligned accesses, then `riscv_hwprobe` will return `SLOW` or `UNSUPPORTED` and `UseUnalignedAccesses` will then be false.
That keeps us in the safer case where we will not generate unaligned accesses if we are not guaranteed that all cores support fast unaligned accesses.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14676#issuecomment-1623893449
More information about the hotspot-dev
mailing list