--- old/src/hotspot/os/linux/os_linux.cpp 2019-10-08 20:01:20.900843759 -0700 +++ new/src/hotspot/os/linux/os_linux.cpp 2019-10-08 20:01:20.516843747 -0700 @@ -3011,6 +3011,24 @@ return 0; } +int os::numa_get_address_id(void* address) { +#ifndef MPOL_F_NODE +#define MPOL_F_NODE (1<<0) // Return next IL mode instead of node mask +#endif + +#ifndef MPOL_F_ADDR +#define MPOL_F_ADDR (1<<1) // Look up VMA using address +#endif + + int id = InvalidId; + + if (syscall(SYS_get_mempolicy, &id, NULL, 0, address, MPOL_F_NODE | MPOL_F_ADDR) == -1) { + warning("Failed to get numa id at " PTR_FORMAT " with errno=%d", p2i((void*)address), errno); + return InvalidId; + } + return id; +} + int os::Linux::get_existing_num_nodes() { int node; int highest_node_number = Linux::numa_max_node();