< prev index next >

src/hotspot/os/linux/os_linux.cpp

Print this page
rev 56323 : imported patch 8220310.mut.0
rev 56326 : [mq]: 8220310.mut.1-3_kim

@@ -3009,10 +3009,28 @@
     }
   }
   return 0;
 }
 
+int os::numa_get_address_id(uintptr_t addr) {
+#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
+  
+  uint32_t id = (uint32_t)-1;
+
+  if (syscall(SYS_get_mempolicy, &id, NULL, 0, addr, MPOL_F_NODE | MPOL_F_ADDR) == -1) {
+    warning("Failed to get numa id at " PTR_FORMAT " with errno=%d", p2i((void*)addr), errno);
+    return os::InvalidId;
+  }
+  return id;
+}
+
 int os::Linux::get_existing_num_nodes() {
   int node;
   int highest_node_number = Linux::numa_max_node();
   int num_nodes = 0;
 
< prev index next >