--- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp Thu Oct 15 10:12:17 2015 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp Thu Oct 15 10:13:08 2015 +0200
@@ -343,11 +343,15 @@
double predict_survivor_regions_evac_time() const;
+ bool should_update_surv_rate_group_predictors() {
+ return collector_state()->last_young_gc() && !collector_state()->in_marking_window();
+ }
+
void cset_regions_freed() {
- bool propagate = collector_state()->should_propagate();
- _short_lived_surv_rate_group->all_surviving_words_recorded(propagate);
- _survivor_surv_rate_group->all_surviving_words_recorded(propagate);
- // also call it on any more surv rate groups
+ bool update = should_update_surv_rate_group_predictors();
+
+ _short_lived_surv_rate_group->all_surviving_words_recorded(update);
+ _survivor_surv_rate_group->all_surviving_words_recorded(update);
}
G1MMUTracker* mmu_tracker() {
--- a/hotspot/src/share/vm/gc/g1/g1CollectorState.hpp Thu Oct 15 10:12:17 2015 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1CollectorState.hpp Thu Oct 15 10:13:08 2015 +0200
@@ -121,10 +121,6 @@
return (_in_marking_window && !_in_marking_window_im);
}
- bool should_propagate() const { // XXX should have a more suitable state name or abstraction for this
- return (_last_young_gc && !_in_marking_window);
- }
-
G1YCType yc_type() const {
if (during_initial_mark_pause()) {
return InitialMark;
--- a/hotspot/src/share/vm/gc/g1/survRateGroup.cpp Thu Oct 15 10:12:17 2015 +0200
+++ b/hotspot/src/share/vm/gc/g1/survRateGroup.cpp Thu Oct 15 10:13:08 2015 +0200
@@ -59,7 +59,6 @@
void SurvRateGroup::reset() {
_all_regions_allocated = 0;
_setup_seq_num = 0;
- _accum_surv_rate = 0.0;
_last_pred = 0.0;
// the following will set up the arrays with length 1
_region_num = 1;
@@ -83,7 +82,6 @@
void SurvRateGroup::start_adding_regions() {
_setup_seq_num = _stats_arrays_length;
_region_num = 0;
- _accum_surv_rate = 0.0;
}
void SurvRateGroup::stop_adding_regions() {
@@ -121,25 +119,7 @@
}
}
-double SurvRateGroup::accum_surv_rate(size_t adjustment) {
- // we might relax this one in the future...
- guarantee( adjustment == 0 || adjustment == 1, "pre-condition" );
-
- double ret = _accum_surv_rate;
- if (adjustment > 0) {
- TruncatedSeq* seq = get_seq(_region_num+1);
- double surv_rate = get_new_prediction(seq);
- ret += surv_rate;
- }
-
- return ret;
-}
-
int SurvRateGroup::next_age_index() {
- TruncatedSeq* seq = get_seq(_region_num);
- double surv_rate = get_new_prediction(seq);
- _accum_surv_rate += surv_rate;
-
++_region_num;
return (int) ++_all_regions_allocated;
}
@@ -160,8 +140,8 @@
}
}
-void SurvRateGroup::all_surviving_words_recorded(bool propagate) {
- if (propagate && _region_num > 0) { // conservative
+void SurvRateGroup::all_surviving_words_recorded(bool update_predictors) {
+ if (update_predictors && _region_num > 0) { // conservative
double surv_rate = _surv_rate_pred[_region_num-1]->last();
for (size_t i = _region_num; i < _stats_arrays_length; ++i) {
guarantee( _surv_rate[i] <= 0.00001,
--- a/hotspot/src/share/vm/gc/g1/survRateGroup.hpp Thu Oct 15 10:12:17 2015 +0200
+++ b/hotspot/src/share/vm/gc/g1/survRateGroup.hpp Thu Oct 15 10:13:08 2015 +0200
@@ -41,7 +41,6 @@
double* _surv_rate;
double* _accum_surv_rate_pred;
double _last_pred;
- double _accum_surv_rate;
TruncatedSeq** _surv_rate_pred;
NumberSeq** _summary_surv_rates;
size_t _summary_surv_rates_len;
@@ -59,7 +58,7 @@
void start_adding_regions();
void stop_adding_regions();
void record_surviving_words(int age_in_group, size_t surv_words);
- void all_surviving_words_recorded(bool propagate);
+ void all_surviving_words_recorded(bool update_predictors);
const char* name() { return _name; }
size_t region_num() { return _region_num; }
@@ -73,8 +72,6 @@
}
}
- double accum_surv_rate(size_t adjustment);
-
TruncatedSeq* get_seq(size_t age) const {
if (age >= _setup_seq_num) {
guarantee( _setup_seq_num > 0, "invariant" );