RFR: 8268014: Build failure on SUSE Linux Enterprise Server 11.4 (s390x) due to 'SYS_get_mempolicy' was not declared [v5]

David Holmes dholmes at openjdk.java.net
Thu Jun 3 03:01:42 UTC 2021


On Thu, 3 Jun 2021 02:48:50 GMT, Jie Fu <jiefu at openjdk.org> wrote:

>> src/hotspot/os/linux/os_linux.cpp line 2976:
>> 
>>> 2974:     return false;
>>> 2975:   }
>>> 2976: #endif
>> 
>> If SYS_get_mempolicy is not defined then surely this must return false?
>
>> 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

Okay.

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

PR: https://git.openjdk.java.net/jdk/pull/4277


More information about the hotspot-runtime-dev mailing list