< prev index next >

src/hotspot/os/windows/os_windows.cpp

Print this page
rev 59057 : imported patch fix

@@ -4094,14 +4094,21 @@
 
   if (UseNUMA && !ForceNUMA) {
     UseNUMA = false; // We don't fully support this yet
   }
 
-  if (UseNUMAInterleaving) {
-    // first check whether this Windows OS supports VirtualAllocExNuma, if not ignore this flag
-    bool success = numa_interleaving_init();
-    if (!success) UseNUMAInterleaving = false;
+  // If UseNUMA then UseNUMAInterleaving is later (Arguments) defaulted to
+  // true, but that's too late to call numa_interleaving_init.
+  if (UseNUMAInterleaving || (UseNUMA && FLAG_IS_DEFAULT(UseNUMAInterleaving))) {
+    // Check whether this Windows OS provides the needed support.
+    if (!numa_interleaving_init()) {
+      // Not supported, so disable flag and prevent later defaulted change.
+      FLAG_SET_ERGO(UseNUMAInterleaving, false);
+    } else if (!UseNUMAInterleaving) {
+      // Supported, so change flag now, rather than waiting for Arguments.
+      FLAG_SET_ERGO(UseNUMAInterleaving, true);
+    }
   }
 
   if (initSock() != JNI_OK) {
     return JNI_ERR;
   }
< prev index next >