8153360: G1HRRSFlushLogBuffersOnVerify with remembered set verification does not work
authorehelin
Mon, 03 Jul 2017 17:19:11 +0200
changeset 46611 3b8b1f7ee3b4
parent 46609 54423de91ff7
child 46612 c6b7c98e33ba
8153360: G1HRRSFlushLogBuffersOnVerify with remembered set verification does not work Reviewed-by: sjohanss, tschatzl
hotspot/src/share/vm/gc/g1/g1HeapVerifier.cpp
hotspot/src/share/vm/gc/g1/g1RemSet.cpp
hotspot/src/share/vm/gc/g1/g1RemSet.hpp
hotspot/src/share/vm/gc/g1/g1_globals.hpp
hotspot/src/share/vm/gc/g1/heapRegion.cpp
--- a/hotspot/src/share/vm/gc/g1/g1HeapVerifier.cpp	Mon Jul 03 14:24:07 2017 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1HeapVerifier.cpp	Mon Jul 03 17:19:11 2017 +0200
@@ -504,7 +504,6 @@
   if (SafepointSynchronize::is_at_safepoint() || ! UseTLAB) {
     _g1h->ensure_parsability(false);
   }
-  _g1h->g1_rem_set()->prepare_for_verify();
 }
 
 double G1HeapVerifier::verify(bool guard, const char* msg) {
--- a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp	Mon Jul 03 14:24:07 2017 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp	Mon Jul 03 17:19:11 2017 +0200
@@ -805,29 +805,6 @@
   }
 }
 
-void G1RemSet::prepare_for_verify() {
-  if (G1HRRSFlushLogBuffersOnVerify &&
-      (VerifyBeforeGC || VerifyAfterGC)
-      &&  (!_g1->collector_state()->full_collection() || G1VerifyRSetsDuringFullGC)) {
-    cleanupHRRS();
-    _g1->set_refine_cte_cl_concurrency(false);
-    if (SafepointSynchronize::is_at_safepoint()) {
-      DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
-      dcqs.concatenate_logs();
-    }
-
-    bool use_hot_card_cache = _hot_card_cache->use_cache();
-    _hot_card_cache->set_use_cache(false);
-
-    DirtyCardQueue into_cset_dcq(&_into_cset_dirty_card_queue_set);
-    update_rem_set(&into_cset_dcq, NULL, 0);
-    _into_cset_dirty_card_queue_set.clear();
-
-    _hot_card_cache->set_use_cache(use_hot_card_cache);
-    assert(JavaThread::dirty_card_queue_set().completed_buffers_num() == 0, "All should be consumed");
-  }
-}
-
 void G1RemSet::create_card_live_data(WorkGang* workers, G1CMBitMap* mark_bitmap) {
   _card_live_data.create(workers, mark_bitmap);
 }
--- a/hotspot/src/share/vm/gc/g1/g1RemSet.hpp	Mon Jul 03 14:24:07 2017 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1RemSet.hpp	Mon Jul 03 17:19:11 2017 +0200
@@ -148,9 +148,6 @@
   // Print accumulated summary info from the last time called.
   void print_periodic_summary_info(const char* header, uint period_count);
 
-  // Prepare remembered set for verification.
-  void prepare_for_verify();
-
   size_t conc_refine_cards() const { return _conc_refine_cards; }
 
   void create_card_live_data(WorkGang* workers, G1CMBitMap* mark_bitmap);
--- a/hotspot/src/share/vm/gc/g1/g1_globals.hpp	Mon Jul 03 14:24:07 2017 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1_globals.hpp	Mon Jul 03 17:19:11 2017 +0200
@@ -199,9 +199,6 @@
   develop(bool, G1HRRSUseSparseTable, true,                                 \
           "When true, use sparse table to save space.")                     \
                                                                             \
-  develop(bool, G1HRRSFlushLogBuffersOnVerify, false,                       \
-          "Forces flushing of log buffers before verification.")            \
-                                                                            \
   product(size_t, G1HeapRegionSize, 0,                                      \
           "Size of the G1 regions.")                                        \
           range(0, 32*M)                                                    \
--- a/hotspot/src/share/vm/gc/g1/heapRegion.cpp	Mon Jul 03 14:24:07 2017 +0200
+++ b/hotspot/src/share/vm/gc/g1/heapRegion.cpp	Mon Jul 03 17:19:11 2017 +0200
@@ -579,10 +579,9 @@
 
         bool is_bad = !(from->is_young()
           || to->rem_set()->contains_reference(p)
-          || !G1HRRSFlushLogBuffersOnVerify && // buffers were not flushed
-          (_containing_obj->is_objArray() ?
-          cv_field == dirty
-          : cv_obj == dirty || cv_field == dirty));
+          || (_containing_obj->is_objArray() ?
+                cv_field == dirty :
+                cv_obj == dirty || cv_field == dirty));
         if (is_bad) {
           MutexLockerEx x(ParGCRareEvent_lock,
             Mutex::_no_safepoint_check_flag);