8232777: Rename G1Policy::_max_rs_length as it is no maximum
authortschatzl
Fri, 25 Oct 2019 12:33:30 +0200
changeset 58797 f29ca6895893
parent 58796 7608c17b7463
child 58798 08e78887ff96
8232777: Rename G1Policy::_max_rs_length as it is no maximum Reviewed-by: kbarrett, sjohanss
src/hotspot/share/gc/g1/g1CollectedHeap.cpp
src/hotspot/share/gc/g1/g1Policy.cpp
src/hotspot/share/gc/g1/g1Policy.hpp
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Fri Oct 25 12:34:30 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Fri Oct 25 12:33:30 2019 +0200
@@ -4098,7 +4098,7 @@
     _cl.complete_work();
 
     G1Policy* policy = G1CollectedHeap::heap()->policy();
-    policy->record_max_rs_length(_rs_length);
+    policy->record_rs_length(_rs_length);
     policy->cset_regions_freed();
   }
 public:
--- a/src/hotspot/share/gc/g1/g1Policy.cpp	Fri Oct 25 12:34:30 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1Policy.cpp	Fri Oct 25 12:33:30 2019 +0200
@@ -68,7 +68,7 @@
   _reserve_regions(0),
   _young_gen_sizer(G1YoungGenSizer::create_gen_sizer()),
   _free_regions_at_end_of_collection(0),
-  _max_rs_length(0),
+  _rs_length(0),
   _rs_length_prediction(0),
   _pending_cards_at_gc_start(0),
   _pending_cards_at_prev_gc_end(0),
@@ -753,13 +753,13 @@
       _analytics->report_cost_per_remset_card_ms(cost_per_remset_card_ms, this_pause_was_young_only);
     }
 
-    if (_max_rs_length > 0) {
+    if (_rs_length > 0) {
       double cards_per_entry_ratio =
-        (double) remset_cards_scanned / (double) _max_rs_length;
+        (double) remset_cards_scanned / (double) _rs_length;
       _analytics->report_cards_per_entry_ratio(cards_per_entry_ratio, this_pause_was_young_only);
     }
 
-    // This is defensive. For a while _max_rs_length could get
+    // This is defensive. For a while _rs_length could get
     // smaller than _recorded_rs_length which was causing
     // rs_length_diff to get very large and mess up the RSet length
     // predictions. The reason was unsafe concurrent updates to the
@@ -774,8 +774,8 @@
     // conditional below just in case.
     size_t rs_length_diff = 0;
     size_t recorded_rs_length = _collection_set->recorded_rs_length();
-    if (_max_rs_length > recorded_rs_length) {
-      rs_length_diff = _max_rs_length - recorded_rs_length;
+    if (_rs_length > recorded_rs_length) {
+      rs_length_diff = _rs_length - recorded_rs_length;
     }
     _analytics->report_rs_length_diff((double) rs_length_diff);
 
@@ -806,7 +806,7 @@
     // During mixed gc we do not use them for young gen sizing.
     if (this_pause_was_young_only) {
       _analytics->report_pending_cards((double) _pending_cards_at_gc_start);
-      _analytics->report_rs_length((double) _max_rs_length);
+      _analytics->report_rs_length((double) _rs_length);
     }
   }
 
--- a/src/hotspot/share/gc/g1/g1Policy.hpp	Fri Oct 25 12:34:30 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1Policy.hpp	Fri Oct 25 12:33:30 2019 +0200
@@ -96,7 +96,7 @@
 
   uint _free_regions_at_end_of_collection;
 
-  size_t _max_rs_length;
+  size_t _rs_length;
 
   size_t _rs_length_prediction;
 
@@ -136,8 +136,8 @@
     hr->install_surv_rate_group(_survivor_surv_rate_group);
   }
 
-  void record_max_rs_length(size_t rs_length) {
-    _max_rs_length = rs_length;
+  void record_rs_length(size_t rs_length) {
+    _rs_length = rs_length;
   }
 
   double predict_base_elapsed_time_ms(size_t pending_cards) const;