1.1 --- a/src/os/linux/vm/os_linux.cpp Mon Jun 26 02:04:40 2017 -0700 1.2 +++ b/src/os/linux/vm/os_linux.cpp Wed Jun 07 13:59:35 2017 -0400 1.3 @@ -2819,11 +2819,8 @@ 1.4 extern "C" JNIEXPORT void numa_error(char *where) { } 1.5 extern "C" JNIEXPORT int fork1() { return fork(); } 1.6 1.7 - 1.8 -// If we are running with libnuma version > 2, then we should 1.9 -// be trying to use symbols with versions 1.1 1.10 -// If we are running with earlier version, which did not have symbol versions, 1.11 -// we should use the base version. 1.12 +// Handle request to load libnuma symbol version 1.1 (API v1). If it fails 1.13 +// load symbol from base version instead. 1.14 void* os::Linux::libnuma_dlsym(void* handle, const char *name) { 1.15 void *f = dlvsym(handle, name, "libnuma_1.1"); 1.16 if (f == NULL) { 1.17 @@ -2832,6 +2829,12 @@ 1.18 return f; 1.19 } 1.20 1.21 +// Handle request to load libnuma symbol version 1.2 (API v2) only. 1.22 +// Return NULL if the symbol is not defined in this particular version. 1.23 +void* os::Linux::libnuma_v2_dlsym(void* handle, const char* name) { 1.24 + return dlvsym(handle, name, "libnuma_1.2"); 1.25 +} 1.26 + 1.27 bool os::Linux::libnuma_init() { 1.28 // sched_getcpu() should be in libc. 1.29 set_sched_getcpu(CAST_TO_FN_PTR(sched_getcpu_func_t, 1.30 @@ -2856,6 +2859,8 @@ 1.31 libnuma_dlsym(handle, "numa_tonode_memory"))); 1.32 set_numa_interleave_memory(CAST_TO_FN_PTR(numa_interleave_memory_func_t, 1.33 libnuma_dlsym(handle, "numa_interleave_memory"))); 1.34 + set_numa_interleave_memory_v2(CAST_TO_FN_PTR(numa_interleave_memory_v2_func_t, 1.35 + libnuma_v2_dlsym(handle, "numa_interleave_memory"))); 1.36 set_numa_set_bind_policy(CAST_TO_FN_PTR(numa_set_bind_policy_func_t, 1.37 libnuma_dlsym(handle, "numa_set_bind_policy"))); 1.38 set_numa_bitmask_isbitset(CAST_TO_FN_PTR(numa_bitmask_isbitset_func_t, 1.39 @@ -2975,6 +2980,7 @@ 1.40 os::Linux::numa_available_func_t os::Linux::_numa_available; 1.41 os::Linux::numa_tonode_memory_func_t os::Linux::_numa_tonode_memory; 1.42 os::Linux::numa_interleave_memory_func_t os::Linux::_numa_interleave_memory; 1.43 +os::Linux::numa_interleave_memory_v2_func_t os::Linux::_numa_interleave_memory_v2; 1.44 os::Linux::numa_set_bind_policy_func_t os::Linux::_numa_set_bind_policy; 1.45 os::Linux::numa_bitmask_isbitset_func_t os::Linux::_numa_bitmask_isbitset; 1.46 os::Linux::numa_distance_func_t os::Linux::_numa_distance;