Skip to content

Commit 7542e90

Browse files
author
William Kemper
committed
8335347: GenShen: Revert change that has adaptive heuristic ignore abbreviated cycles
Reviewed-by: kdnilsen
1 parent 9d2712d commit 7542e90

10 files changed

+12
-25
lines changed

src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ void ShenandoahAdaptiveHeuristics::record_cycle_start() {
132132
_allocation_rate.allocation_counter_reset();
133133
}
134134

135-
void ShenandoahAdaptiveHeuristics::record_success_concurrent(bool abbreviated) {
136-
ShenandoahHeuristics::record_success_concurrent(abbreviated);
135+
void ShenandoahAdaptiveHeuristics::record_success_concurrent() {
136+
ShenandoahHeuristics::record_success_concurrent();
137137

138138
size_t available = _space_info->available();
139139

src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class ShenandoahAdaptiveHeuristics : public ShenandoahHeuristics {
7676
size_t actual_free);
7777

7878
void record_cycle_start();
79-
void record_success_concurrent(bool abbreviated);
79+
void record_success_concurrent();
8080
void record_success_degenerated();
8181
void record_success_full();
8282

src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,11 @@ void ShenandoahHeuristics::adjust_penalty(intx step) {
220220
"In range after adjustment: " INTX_FORMAT, _gc_time_penalties);
221221
}
222222

223-
void ShenandoahHeuristics::record_success_concurrent(bool abbreviated) {
223+
void ShenandoahHeuristics::record_success_concurrent() {
224+
_gc_cycle_time_history->add(elapsed_cycle_time());
224225
_gc_times_learned++;
225226

226227
adjust_penalty(Concurrent_Adjust);
227-
228-
if (_gc_times_learned <= ShenandoahLearningSteps || !(abbreviated && ShenandoahAdaptiveIgnoreShortCycles)) {
229-
_gc_cycle_time_history->add(elapsed_cycle_time());
230-
}
231228
}
232229

233230
void ShenandoahHeuristics::record_success_degenerated() {

src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class ShenandoahHeuristics : public CHeapObj<mtGC> {
141141

142142
virtual bool should_degenerate_cycle();
143143

144-
virtual void record_success_concurrent(bool abbreviated);
144+
virtual void record_success_concurrent();
145145

146146
virtual void record_success_degenerated();
147147

src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,10 +685,10 @@ bool ShenandoahOldHeuristics::should_start_gc() {
685685
return this->ShenandoahHeuristics::should_start_gc();
686686
}
687687

688-
void ShenandoahOldHeuristics::record_success_concurrent(bool abbreviated) {
688+
void ShenandoahOldHeuristics::record_success_concurrent() {
689689
// Forget any triggers that occurred while OLD GC was ongoing. If we really need to start another, it will retrigger.
690690
clear_triggers();
691-
this->ShenandoahHeuristics::record_success_concurrent(abbreviated);
691+
this->ShenandoahHeuristics::record_success_concurrent();
692692
}
693693

694694
void ShenandoahOldHeuristics::record_success_degenerated() {

src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ class ShenandoahOldHeuristics : public ShenandoahHeuristics {
189189

190190
bool should_start_gc() override;
191191

192-
void record_success_concurrent(bool abbreviated) override;
192+
void record_success_concurrent() override;
193193

194194
void record_success_degenerated() override;
195195

src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ void ShenandoahControlThread::service_concurrent_normal_cycle(GCCause::Cause cau
327327
if (gc.collect(cause)) {
328328
// Cycle is complete
329329
heap->notify_gc_progress();
330-
heap->global_generation()->heuristics()->record_success_concurrent(gc.abbreviated());
330+
heap->global_generation()->heuristics()->record_success_concurrent();
331331
heap->shenandoah_policy()->record_success_concurrent(false, gc.abbreviated());
332332
heap->log_heap_status("At end of GC");
333333
} else {

src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,6 @@ size_t ShenandoahGeneration::decrease_capacity(size_t decrement) {
10171017
}
10181018

10191019
void ShenandoahGeneration::record_success_concurrent(bool abbreviated) {
1020-
heuristics()->record_success_concurrent(abbreviated);
1020+
heuristics()->record_success_concurrent();
10211021
ShenandoahHeap::heap()->shenandoah_policy()->record_success_concurrent(is_young(), abbreviated);
10221022
}

src/hotspot/share/gc/shenandoah/shenandoahOldGeneration.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ ShenandoahHeuristics* ShenandoahOldGeneration::initialize_heuristics(ShenandoahM
618618
}
619619

620620
void ShenandoahOldGeneration::record_success_concurrent(bool abbreviated) {
621-
heuristics()->record_success_concurrent(abbreviated);
621+
heuristics()->record_success_concurrent();
622622
ShenandoahHeap::heap()->shenandoah_policy()->record_success_old();
623623
}
624624

src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -259,16 +259,6 @@
259259
"Larger values give more weight to recent values.") \
260260
range(0,1.0) \
261261
\
262-
product(bool, ShenandoahAdaptiveIgnoreShortCycles, true, EXPERIMENTAL, \
263-
"The adaptive heuristic tracks a moving average of cycle " \
264-
"times in order to start a gc before memory is exhausted. " \
265-
"In some cases, Shenandoah may skip the evacuation and update " \
266-
"reference phases, resulting in a shorter cycle. These may skew " \
267-
"the average cycle time downward and may cause the heuristic " \
268-
"to wait too long to start a cycle. Disabling this will have " \
269-
"the gc run less often, which will reduce CPU utilization, but" \
270-
"increase the risk of degenerated cycles.") \
271-
\
272262
product(uintx, ShenandoahGuaranteedGCInterval, 5*60*1000, EXPERIMENTAL, \
273263
"Many heuristics would guarantee a concurrent GC cycle at " \
274264
"least with this interval. This is useful when large idle " \

0 commit comments

Comments
 (0)