RFR: 8321075: RISC-V: UseSystemMemoryBarrier lacking proper OS support [v2]

Robbin Ehn rehn at openjdk.org
Mon Feb 19 11:28:54 UTC 2024


On Mon, 19 Feb 2024 09:30:59 GMT, Fei Yang <fyang at openjdk.org> wrote:

> Hi, Just wondering if there will be a plan for the kernel fix to be backported to some longterm kernel versions like 6.6, 5.10 or even 4.19? UseSystemMemoryBarrier won't be usable with this change when we are running on top of those older kernels if that happens.

It's actually even worse, as distributions cherry-pick a bunch out of tree patches on top of their kernels.

The issue is that the kernel is lying to us:
long ret = membarrier(MEMBARRIER_CMD_QUERY, 0, 0);
Will return that MEMBARRIER PRIVATE_EXPEDITED is supported!

As we can't trust that syscall, we have no idea, and there is no patch to fix this behavior, i.e. to return unsupported. 

So I rather not having people use this than people using this on unpatched kernels.

Sorry no good option here AFAICT.

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

PR Comment: https://git.openjdk.org/jdk/pull/17889#issuecomment-1952247954


More information about the hotspot-runtime-dev mailing list