8232776: G1 should always take rs_length_diff into account when predicting rs_lengths
authortschatzl
Fri, 25 Oct 2019 12:32:46 +0200
changeset 58798 08e78887ff96
parent 58797 f29ca6895893
child 58799 eb491334113f
child 58800 dc5d2d009d60
8232776: G1 should always take rs_length_diff into account when predicting rs_lengths Reviewed-by: sangheki, kbarrett
src/hotspot/share/gc/g1/g1Analytics.cpp
src/hotspot/share/gc/g1/g1Analytics.hpp
src/hotspot/share/gc/g1/g1Policy.cpp
--- a/src/hotspot/share/gc/g1/g1Analytics.cpp	Fri Oct 25 12:33:30 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1Analytics.cpp	Fri Oct 25 12:32:46 2019 +0200
@@ -229,10 +229,6 @@
   _rs_length_seq->add(rs_length);
 }
 
-size_t G1Analytics::predict_rs_length_diff() const {
-  return get_new_size_prediction(_rs_length_diff_seq);
-}
-
 double G1Analytics::predict_alloc_rate_ms() const {
   return get_new_prediction(_alloc_rate_ms_seq);
 }
@@ -334,7 +330,7 @@
 }
 
 size_t G1Analytics::predict_rs_length() const {
-  return get_new_size_prediction(_rs_length_seq);
+  return get_new_size_prediction(_rs_length_seq) + get_new_prediction(_rs_length_diff_seq);
 }
 
 size_t G1Analytics::predict_pending_cards() const {
--- a/src/hotspot/share/gc/g1/g1Analytics.hpp	Fri Oct 25 12:33:30 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1Analytics.hpp	Fri Oct 25 12:32:46 2019 +0200
@@ -115,8 +115,6 @@
   void report_pending_cards(double pending_cards);
   void report_rs_length(double rs_length);
 
-  size_t predict_rs_length_diff() const;
-
   double predict_alloc_rate_ms() const;
   int num_alloc_rate_ms() const;
 
--- a/src/hotspot/share/gc/g1/g1Policy.cpp	Fri Oct 25 12:33:30 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1Policy.cpp	Fri Oct 25 12:32:46 2019 +0200
@@ -330,8 +330,7 @@
   const double target_pause_time_ms = _mmu_tracker->max_gc_time() * 1000.0;
   const double survivor_regions_evac_time = predict_survivor_regions_evac_time();
   const size_t pending_cards = _analytics->predict_pending_cards();
-  const size_t adj_rs_length = rs_length + _analytics->predict_rs_length_diff();
-  const size_t scanned_cards = _analytics->predict_card_num(adj_rs_length, true /* for_young_gc */);
+  const size_t scanned_cards = _analytics->predict_card_num(rs_length, true /* for_young_gc */);
   const double base_time_ms =
     predict_base_elapsed_time_ms(pending_cards, scanned_cards) +
     survivor_regions_evac_time;
@@ -951,7 +950,7 @@
 }
 
 double G1Policy::predict_base_elapsed_time_ms(size_t pending_cards) const {
-  size_t rs_length = _analytics->predict_rs_length() + _analytics->predict_rs_length_diff();
+  size_t rs_length = _analytics->predict_rs_length();
   size_t card_num = _analytics->predict_card_num(rs_length, collector_state()->in_young_only_phase());
   return predict_base_elapsed_time_ms(pending_cards, card_num);
 }