8150362: G1 base elapsed time prediction is wrong because rs_length prediction is wrong
authorsangheki
Wed, 09 Mar 2016 11:08:49 -0800
changeset 37051 b02a3fb98142
parent 37050 85b12760d820
child 37053 4eac559b9503
8150362: G1 base elapsed time prediction is wrong because rs_length prediction is wrong Summary: Change rs_length prediction used from G1 base elapsed time prediction Reviewed-by: mgerdin, tschatzl
hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp
hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp
--- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp	Wed Mar 09 14:18:12 2016 +0100
+++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp	Wed Mar 09 11:08:49 2016 -0800
@@ -409,7 +409,7 @@
 }
 
 uint G1CollectorPolicy::update_young_list_max_and_target_length() {
-  return update_young_list_max_and_target_length(get_new_size_prediction(_rs_lengths_seq));
+  return update_young_list_max_and_target_length(predict_rs_lengths());
 }
 
 uint G1CollectorPolicy::update_young_list_max_and_target_length(size_t rs_lengths) {
@@ -616,7 +616,7 @@
 }
 
 void G1CollectorPolicy::update_rs_lengths_prediction() {
-  update_rs_lengths_prediction(get_new_size_prediction(_rs_lengths_seq));
+  update_rs_lengths_prediction(predict_rs_lengths());
 }
 
 void G1CollectorPolicy::update_rs_lengths_prediction(size_t prediction) {
@@ -1150,6 +1150,10 @@
   dcqs.notify_if_necessary();
 }
 
+size_t G1CollectorPolicy::predict_rs_lengths() const {
+  return get_new_size_prediction(_rs_lengths_seq);
+}
+
 size_t G1CollectorPolicy::predict_rs_length_diff() const {
   return get_new_size_prediction(_rs_length_diff_seq);
 }
@@ -1269,7 +1273,7 @@
 }
 
 double G1CollectorPolicy::predict_base_elapsed_time_ms(size_t pending_cards) const {
-  size_t rs_length = predict_rs_length_diff();
+  size_t rs_length = predict_rs_lengths() + predict_rs_length_diff();
   size_t card_num;
   if (collector_state()->gcs_are_young()) {
     card_num = predict_young_card_num(rs_length);
--- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp	Wed Mar 09 14:18:12 2016 +0100
+++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp	Wed Mar 09 11:08:49 2016 -0800
@@ -177,6 +177,8 @@
     _max_rs_lengths = rs_lengths;
   }
 
+  size_t predict_rs_lengths() const;
+
   size_t predict_rs_length_diff() const;
 
   double predict_alloc_rate_ms() const;