Linux risc-v port is lacking correct barriers in the kernel for the membarrier() syscall to actually have the correct semantic in user-space.
https://lore.kernel.org/lkml/041c83e6-1ca5-4953-bcec-03571135165d@efficios.com/
UseSystemMemoryBarrier should not be allowed to turned on when running on Linux/RV.
There is no way telling from the syscall if this is on non-working kernel or a post 6.6 (cross-fingers it get fixed to 6.7) with a working syscall.
The linux membarrier wrapper should probably be informed on the current kernel version to determine if it's usable or not.