Skip to content

Commit

Permalink
Revert "8343086: [BACKOUT] JDK-8295269 G1: Improve slow startup due t…
Browse files Browse the repository at this point in the history
…o predictor initialization"

This reverts commit f1cc890.
  • Loading branch information
tschatzl committed Nov 4, 2024
1 parent e7f0bf1 commit 4ee7c25
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/hotspot/share/gc/g1/g1AnalyticsSequences.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class G1Predictions;
// Container for TruncatedSeqs that need separate predictors by GC phase.
class G1PhaseDependentSeq {
TruncatedSeq _young_only_seq;
double _initial_value;
TruncatedSeq _mixed_seq;

NONCOPYABLE(G1PhaseDependentSeq);
Expand Down
7 changes: 6 additions & 1 deletion src/hotspot/share/gc/g1/g1AnalyticsSequences.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ bool G1PhaseDependentSeq::enough_samples_to_use_mixed_seq() const {

G1PhaseDependentSeq::G1PhaseDependentSeq(int length) :
_young_only_seq(length),
_initial_value(0.0),
_mixed_seq(length)
{ }

Expand All @@ -42,7 +43,7 @@ TruncatedSeq* G1PhaseDependentSeq::seq_raw(bool use_young_only_phase_seq) {
}

void G1PhaseDependentSeq::set_initial(double value) {
_young_only_seq.add(value);
_initial_value = value;
}

void G1PhaseDependentSeq::add(double value, bool for_young_only_phase) {
Expand All @@ -51,8 +52,12 @@ void G1PhaseDependentSeq::add(double value, bool for_young_only_phase) {

double G1PhaseDependentSeq::predict(const G1Predictions* predictor, bool use_young_only_phase_seq) const {
if (use_young_only_phase_seq || !enough_samples_to_use_mixed_seq()) {
if (_young_only_seq.num() == 0) {
return _initial_value;
}
return predictor->predict(&_young_only_seq);
} else {
assert(_mixed_seq.num() > 0, "must not ask this with no samples");
return predictor->predict(&_mixed_seq);
}
}
Expand Down

0 comments on commit 4ee7c25

Please sign in to comment.