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

Jie Fu jiefu at openjdk.java.net
Wed Jun 2 13:33:32 UTC 2021


On Wed, 2 Jun 2021 13:13:33 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> Regarding a shorter version, then maybe this one (its ugly but should work my colleagues told me the old value 236 for the mempolicy would be recognized too ).

So it sounds really ugly.

What do you think of this fix?

diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp
index e3a7e28..4044b7b 100644
--- a/src/hotspot/os/linux/os_linux.cpp
+++ b/src/hotspot/os/linux/os_linux.cpp
@@ -2963,6 +2963,7 @@ void* os::Linux::libnuma_v2_dlsym(void* handle, const char* name) {
 
 // Check numa dependent syscalls
 static bool numa_syscall_check() {
+#ifdef SYS_get_mempolicy
   // NUMA APIs depend on several syscalls. E.g., get_mempolicy is required for numa_get_membind and
   // numa_get_interleave_mask. But these dependent syscalls can be unsupported for various reasons.
   // Especially in dockers, get_mempolicy is not allowed with the default configuration. So it's necessary
@@ -2972,6 +2973,7 @@ static bool numa_syscall_check() {
   if (syscall(SYS_get_mempolicy, &dummy, NULL, 0, (void*)&dummy, 3) == -1) {
     return false;
   }
+#endif
 
   return true;
 }

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

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


More information about the hotspot-runtime-dev mailing list