RFR: 8268014: Build failure on SUSE Linux Enterprise Server 11.4 (s390x) due to 'SYS_get_mempolicy' was not declared [v5]
Jie Fu
jiefu at openjdk.java.net
Thu Jun 3 02:51:33 UTC 2021
On Thu, 3 Jun 2021 02:17:18 GMT, David Holmes <dholmes at openjdk.org> wrote:
> If SYS_get_mempolicy is not defined then surely this must return false?
I don't think so.
No SYS_get_mempolicy symbol doesn't mean get_mempolicy syscall is unsupported.
It may still be invoked directly by its syscall number just like what the libnuma does [1].
The logic is:
1) if defined(SYS_get_mempolicy) and SYS_get_mempolicy returns -1
then get_mempolicy is surely no supported
so numa_syscall_check() must return fasle
2) if not defined(SYS_get_mempolicy)
then get_mempolicy may be supported or not
so it can be wrong no matter what numa_syscall_check() returns.
However, for case 2), we can just let numa_syscall_check() return true.
This is fine because all the old JDKs (before jdk17) actually assume that get_mempolicy is always supported by default.
Another reason is that numa_syscall_check() is designed to do its best effort checks of numa related syscalls.
Even numa_syscall_check() return true, it still not guarantee that all numa required syscalls are supported since only get_mempolicy is checked currently.
But this is already enough for dockers with the default configuration.
Also, I think there should be SYS_get_mempolicy definition for almost all modern systems.
So the harmless false positive should be very very rare.
Thanks.
[1] https://github.com/numactl/numactl/blob/master/syscall.c#L121
-------------
PR: https://git.openjdk.java.net/jdk/pull/4277
More information about the hotspot-runtime-dev
mailing list