diff src/os/solaris/vm/os_solaris.cpp @ 3292:c303b3532d4a

7037939: NUMA: Disable adaptive resizing if SHM large pages are used Summary: Make the NUMA allocator behave properly with SHM and ISM large pages. Reviewed-by: ysr
author iveresov
date Tue, 26 Apr 2011 11:46:34 -0700
parents 23ae54207126
children 188c9a5d6a6d
line wrap: on
line diff
--- a/src/os/solaris/vm/os_solaris.cpp	Sat Apr 23 04:20:09 2011 -0700
+++ b/src/os/solaris/vm/os_solaris.cpp	Tue Apr 26 11:46:34 2011 -0700
@@ -2826,7 +2826,9 @@
 void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
   assert((intptr_t)addr % alignment_hint == 0, "Address should be aligned.");
   assert((intptr_t)(addr + bytes) % alignment_hint == 0, "End should be aligned.");
-  Solaris::set_mpss_range(addr, bytes, alignment_hint);
+  if (UseLargePages && UseMPSS) {
+    Solaris::set_mpss_range(addr, bytes, alignment_hint);
+  }
 }
 
 // Tell the OS to make the range local to the first-touching LWP
@@ -5044,6 +5046,20 @@
         UseNUMA = false;
       }
     }
+    // ISM is not compatible with the NUMA allocator - it always allocates
+    // pages round-robin across the lgroups.
+    if (UseNUMA && UseLargePages && UseISM) {
+      if (!FLAG_IS_DEFAULT(UseNUMA)) {
+        if (FLAG_IS_DEFAULT(UseLargePages) && FLAG_IS_DEFAULT(UseISM)) {
+          UseLargePages = false;
+        } else {
+          warning("UseNUMA is not compatible with ISM large pages, disabling NUMA allocator");
+          UseNUMA = false;
+        }
+      } else {
+        UseNUMA = false;
+      }
+    }
     if (!UseNUMA && ForceNUMA) {
       UseNUMA = true;
     }