Merge
authorhseigel
Tue, 14 Jun 2016 19:30:19 +0000
changeset 39284 d504ca981ccf
parent 39283 cce7f4eedf89 (current diff)
parent 39281 84e5f0fc2112 (diff)
child 39285 2ab363810925
child 39287 67f35c905a56
Merge
--- a/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.hpp	Tue Jun 14 14:31:36 2016 -0400
+++ b/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.hpp	Tue Jun 14 19:30:19 2016 +0000
@@ -108,9 +108,9 @@
     // do nothing.  tlabs must be inited by initialize() calls
   }
 
-  static const size_t min_size()                 { return align_object_size(MinTLABSize / HeapWordSize) + alignment_reserve(); }
-  static const size_t max_size()                 { assert(_max_size != 0, "max_size not set up"); return _max_size; }
-  static const size_t max_size_in_bytes()        { return max_size() * BytesPerWord; }
+  static size_t min_size()                       { return align_object_size(MinTLABSize / HeapWordSize) + alignment_reserve(); }
+  static size_t max_size()                       { assert(_max_size != 0, "max_size not set up"); return _max_size; }
+  static size_t max_size_in_bytes()              { return max_size() * BytesPerWord; }
   static void set_max_size(size_t max_size)      { _max_size = max_size; }
 
   HeapWord* start() const                        { return _start; }
--- a/hotspot/test/gc/g1/humongousObjects/objectGraphTest/GC.java	Tue Jun 14 14:31:36 2016 -0400
+++ b/hotspot/test/gc/g1/humongousObjects/objectGraphTest/GC.java	Tue Jun 14 19:30:19 2016 +0000
@@ -38,6 +38,61 @@
  * referenced objects after GCs
  */
 public enum GC {
+    CMC {
+        @Override
+        public Runnable get() {
+            return () -> {
+                Helpers.waitTillCMCFinished(WHITE_BOX, 0);
+                WHITE_BOX.g1StartConcMarkCycle();
+                Helpers.waitTillCMCFinished(WHITE_BOX, 0);
+            };
+        }
+
+        public Consumer<ReferenceInfo<Object[]>> getChecker() {
+            return getCheckerImpl(false, false, true, false);
+        }
+
+        @Override
+        public List<String> shouldContain() {
+            return Arrays.asList(GCTokens.WB_INITIATED_CMC);
+        }
+
+        @Override
+        public List<String> shouldNotContain() {
+            return Arrays.asList(GCTokens.WB_INITIATED_YOUNG_GC, GCTokens.WB_INITIATED_MIXED_GC,
+                    GCTokens.FULL_GC, GCTokens.YOUNG_GC);
+        }
+    },
+
+    CMC_NO_SURV_ROOTS {
+        @Override
+        public Runnable get() {
+            return () -> {
+                WHITE_BOX.youngGC();
+                Helpers.waitTillCMCFinished(WHITE_BOX, 0);
+                WHITE_BOX.youngGC();
+                Helpers.waitTillCMCFinished(WHITE_BOX, 0);
+
+                WHITE_BOX.g1StartConcMarkCycle();
+                Helpers.waitTillCMCFinished(WHITE_BOX, 0);
+            };
+        }
+
+        public Consumer<ReferenceInfo<Object[]>> getChecker() {
+            return getCheckerImpl(true, false, true, false);
+        }
+
+        @Override
+        public List<String> shouldContain() {
+            return Arrays.asList(GCTokens.WB_INITIATED_CMC);
+        }
+
+        @Override
+        public List<String> shouldNotContain() {
+            return Arrays.asList(GCTokens.WB_INITIATED_MIXED_GC,
+                    GCTokens.FULL_GC, GCTokens.YOUNG_GC);
+        }
+    },
 
     YOUNG_GC {
         @Override
@@ -60,6 +115,7 @@
                     GCTokens.CMC, GCTokens.YOUNG_GC);
         }
     },
+
     FULL_GC {
         @Override
         public Runnable get() {
--- a/hotspot/test/gc/g1/humongousObjects/objectGraphTest/README	Tue Jun 14 14:31:36 2016 -0400
+++ b/hotspot/test/gc/g1/humongousObjects/objectGraphTest/README	Tue Jun 14 19:30:19 2016 +0000
@@ -31,6 +31,13 @@
 
 3. Full GC with memory pressure - weakly and softly referenced non-humongous and humongous objects are collected.
 
+4. CMC -  weakly referenced non-humongous objects are collected, other objects are not collected since weak references
+          from Young Gen is handled as strong during CMC.
+
+5. CMC_NO_SURV_ROOTS -  weakly referenced non-humongous and humongous objects are collected, softly referenced
+                        non-humongous and humongous objects are not collected since we make 2 Young GC to promote all
+                        weak references to Old Gen.
+
 The test gets gc type as a command line argument.
 Then the test allocates object graph in heap (currently testing scenarios are pre-generated and stored in
 TestcaseData.getPregeneratedTestcases()) with TestObjectGraphAfterGC::allocateObjectGraph.
--- a/hotspot/test/gc/g1/humongousObjects/objectGraphTest/TestObjectGraphAfterGC.java	Tue Jun 14 14:31:36 2016 -0400
+++ b/hotspot/test/gc/g1/humongousObjects/objectGraphTest/TestObjectGraphAfterGC.java	Tue Jun 14 19:30:19 2016 +0000
@@ -77,6 +77,14 @@
  * -XX:G1HeapRegionSize=1M -Xlog:gc=info:file=TestObjectGraphAfterGC_FULL_GC_MEMORY_PRESSURE.gc.log
  * gc.g1.humongousObjects.objectGraphTest.TestObjectGraphAfterGC FULL_GC_MEMORY_PRESSURE
  *
+ * @run main/othervm -Xms200M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:G1HeapRegionSize=1M -Xlog:gc=info:file=TestObjectGraphAfterGC_CMC.gc.log -XX:MaxTenuringThreshold=16
+ * gc.g1.humongousObjects.objectGraphTest.TestObjectGraphAfterGC CMC
+ *
+ * @run main/othervm -Xms200M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:G1HeapRegionSize=1M -Xlog:gc=info:file=TestObjectGraphAfterGC_CMC_NO_SURV_ROOTS.gc.log -XX:MaxTenuringThreshold=1
+ * gc.g1.humongousObjects.objectGraphTest.TestObjectGraphAfterGC CMC_NO_SURV_ROOTS
+ *
  */
 
 /**
--- a/hotspot/test/runtime/memory/ReserveMemory.java	Tue Jun 14 14:31:36 2016 -0400
+++ b/hotspot/test/runtime/memory/ReserveMemory.java	Tue Jun 14 19:30:19 2016 +0000
@@ -21,10 +21,12 @@
  * questions.
  */
 
+// Aix commits on touch, so this test won't work.
 /*
  * @test
  * @key regression
  * @bug 8012015
+ * @requires !(os.family == "aix")
  * @summary Make sure reserved (but uncommitted) memory is not accessible
  * @library /testlibrary /test/lib
  * @modules java.base/jdk.internal.misc
@@ -36,18 +38,11 @@
  */
 
 import jdk.test.lib.*;
+import jdk.test.lib.Platform;
 
 import sun.hotspot.WhiteBox;
 
 public class ReserveMemory {
-  private static boolean isWindows() {
-    return System.getProperty("os.name").toLowerCase().startsWith("win");
-  }
-
-  private static boolean isOsx() {
-    return System.getProperty("os.name").toLowerCase().startsWith("mac");
-  }
-
   public static void main(String args[]) throws Exception {
     if (args.length > 0) {
       WhiteBox.getWhiteBox().readReservedMemory();
@@ -66,9 +61,9 @@
           "test");
 
     OutputAnalyzer output = new OutputAnalyzer(pb.start());
-    if (isWindows()) {
+    if (Platform.isWindows()) {
       output.shouldContain("EXCEPTION_ACCESS_VIOLATION");
-    } else if (isOsx()) {
+    } else if (Platform.isOSX()) {
       output.shouldContain("SIGBUS");
     } else {
       output.shouldContain("SIGSEGV");