changeset 46353:1df99120f158

8176885: Clear Claimed Marks log message at wrong location in the log Summary: Move message and code to the pre evacuation phase part of the GC Reviewed-by: sjohanss, sangheki
author tschatzl
date Tue, 28 Mar 2017 09:13:00 +0200
parents 4ece6d1f3f76
children dedf3d5f3332 46e3aa269de0
files hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp
diffstat 2 files changed, 17 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp	Tue Mar 28 00:03:23 2017 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp	Tue Mar 28 09:13:00 2017 +0200
@@ -4429,6 +4429,18 @@
 
   g1_rem_set()->prepare_for_oops_into_collection_set_do();
   _preserved_marks_set.assert_empty();
+
+  G1GCPhaseTimes* phase_times = g1_policy()->phase_times();
+
+  // InitialMark needs claim bits to keep track of the marked-through CLDs.
+  if (collector_state()->during_initial_mark_pause()) {
+    double start_clear_claimed_marks = os::elapsedTime();
+
+    ClassLoaderDataGraph::clear_claimed_marks();
+
+    double recorded_clear_claimed_marks_time_ms = (os::elapsedTime() - start_clear_claimed_marks) * 1000.0;
+    phase_times->record_clear_claimed_marks_time_ms(recorded_clear_claimed_marks_time_ms);
+  }
 }
 
 void G1CollectedHeap::evacuate_collection_set(EvacuationInfo& evacuation_info, G1ParScanThreadStateSet* per_thread_states) {
@@ -4439,16 +4451,6 @@
 
   G1GCPhaseTimes* phase_times = g1_policy()->phase_times();
 
-  // InitialMark needs claim bits to keep track of the marked-through CLDs.
-  if (collector_state()->during_initial_mark_pause()) {
-    double start_clear_claimed_marks = os::elapsedTime();
-
-    ClassLoaderDataGraph::clear_claimed_marks();
-
-    double recorded_clear_claimed_marks_time_ms = (os::elapsedTime() - start_clear_claimed_marks) * 1000.0;
-    phase_times->record_clear_claimed_marks_time_ms(recorded_clear_claimed_marks_time_ms);
-  }
-
   double start_par_time_sec = os::elapsedTime();
   double end_par_time_sec;
 
--- a/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp	Tue Mar 28 00:03:23 2017 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp	Tue Mar 28 09:13:00 2017 +0200
@@ -285,7 +285,8 @@
   const double sum_ms = _root_region_scan_wait_time_ms +
                         _recorded_young_cset_choice_time_ms +
                         _recorded_non_young_cset_choice_time_ms +
-                        _cur_fast_reclaim_humongous_register_time_ms;
+                        _cur_fast_reclaim_humongous_register_time_ms +
+                        _recorded_clear_claimed_marks_time_ms;
 
   info_time("Pre Evacuate Collection Set", sum_ms);
 
@@ -300,6 +301,9 @@
     trace_count("Humongous Candidate", _cur_fast_reclaim_humongous_candidates);
   }
 
+  if (_recorded_clear_claimed_marks_time_ms > 0.0) {
+    debug_time("Clear Claimed Marks", _recorded_clear_claimed_marks_time_ms);
+  }
   return sum_ms;
 }
 
@@ -344,7 +348,6 @@
                         _recorded_merge_pss_time_ms +
                         _cur_strong_code_root_purge_time_ms +
                         _recorded_redirty_logged_cards_time_ms +
-                        _recorded_clear_claimed_marks_time_ms +
                         _recorded_total_free_cset_time_ms +
                         _cur_fast_reclaim_humongous_time_ms +
                         _cur_expand_heap_time_ms +
@@ -384,9 +387,6 @@
 #if defined(COMPILER2) || INCLUDE_JVMCI
   debug_time("DerivedPointerTable Update", _cur_derived_pointer_table_update_time_ms);
 #endif
-  if (_recorded_clear_claimed_marks_time_ms > 0.0) {
-    debug_time("Clear Claimed Marks", _recorded_clear_claimed_marks_time_ms);
-  }
 
   debug_time("Free Collection Set", _recorded_total_free_cset_time_ms);
   trace_time("Free Collection Set Serial", _recorded_serial_free_cset_time_ms);