Merge
authortschatzl
Wed, 16 Mar 2016 16:42:30 +0100
changeset 37125 188d715655a3
parent 37121 373b0cfbfd4b (diff)
parent 37124 3d6e0ad0dbfb (current diff)
child 37128 ea9e0371b8e6
Merge
hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp
hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp
--- a/hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp	Wed Mar 16 15:36:42 2016 +0100
+++ b/hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp	Wed Mar 16 16:42:30 2016 +0100
@@ -117,7 +117,6 @@
     // wait until started is set.
     sleepBeforeNextCycle();
     if (should_terminate()) {
-      _cm->root_regions()->cancel_scan();
       break;
     }
 
@@ -284,6 +283,7 @@
       g1h->register_concurrent_cycle_end();
     }
   }
+  _cm->root_regions()->cancel_scan();
 }
 
 void ConcurrentMarkThread::stop_service() {
--- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp	Wed Mar 16 15:36:42 2016 +0100
+++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp	Wed Mar 16 16:42:30 2016 +0100
@@ -3222,10 +3222,13 @@
   _verifier->verify_region_sets_optional();
   _verifier->verify_dirty_young_regions();
 
-  // This call will decide whether this pause is an initial-mark
-  // pause. If it is, during_initial_mark_pause() will return true
-  // for the duration of this pause.
-  g1_policy()->decide_on_conc_mark_initiation();
+  // We should not be doing initial mark unless the conc mark thread is running
+  if (!_cmThread->should_terminate()) {
+    // This call will decide whether this pause is an initial-mark
+    // pause. If it is, during_initial_mark_pause() will return true
+    // for the duration of this pause.
+    g1_policy()->decide_on_conc_mark_initiation();
+  }
 
   // We do not allow initial-mark to be piggy-backed on a mixed GC.
   assert(!collector_state()->during_initial_mark_pause() ||