8061467: Bad page size passed to setup_large_pages() on Solaris
authorehelin
Wed, 05 Nov 2014 16:39:10 +0100
changeset 27630 f5b2d7c500f4
parent 27629 81ea316b7244
child 27631 43e4ac8bc726
8061467: Bad page size passed to setup_large_pages() on Solaris Reviewed-by: tschatzl, mgerdin
hotspot/src/os/solaris/vm/os_solaris.cpp
hotspot/test/gc/TestNUMAPageSize.java
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp	Wed Nov 05 10:12:51 2014 +0100
+++ b/hotspot/src/os/solaris/vm/os_solaris.cpp	Wed Nov 05 16:39:10 2014 +0100
@@ -2607,7 +2607,10 @@
   assert((intptr_t)addr % alignment_hint == 0, "Address should be aligned.");
   assert((intptr_t)(addr + bytes) % alignment_hint == 0, "End should be aligned.");
   if (UseLargePages) {
-    Solaris::setup_large_pages(addr, bytes, alignment_hint);
+    size_t page_size = Solaris::page_size_for_alignment(alignment_hint);
+    if (page_size > (size_t) vm_page_size()) {
+      Solaris::setup_large_pages(addr, bytes, page_size);
+    }
   }
 }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/gc/TestNUMAPageSize.java	Wed Nov 05 16:39:10 2014 +0100
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test TestNUMAPageSize
+ * @summary Make sure that start up with NUMA support does not cause problems.
+ * @bug 8061467
+ * @key gc
+ * @key regression
+ * @run main/othervm -Xmx8M -XX:+UseNUMA TestNUMAPageSize
+ */
+
+public class TestNUMAPageSize {
+  public static void main(String args[]) throws Exception {
+    // nothing to do
+  }
+}