Skip to content

Commit acb6b5f

Browse files
author
William Kemper
committedJul 12, 2024
8335347: GenShen: Revert change that has adaptive heuristic ignore abbreviated cycles
Backport-of: 7542e909d1b4fb8a9a29ab5caf61a6be792f0f03
1 parent 8e2bc91 commit acb6b5f

10 files changed

+12
-25
lines changed
 

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

+2-2
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

+1-1
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

+2-5
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

+1-1
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

+2-2
Original file line numberDiff line numberDiff line change
@@ -686,10 +686,10 @@ bool ShenandoahOldHeuristics::should_start_gc() {
686686
return this->ShenandoahHeuristics::should_start_gc();
687687
}
688688

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

695695
void ShenandoahOldHeuristics::record_success_degenerated() {

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

+1-1
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ void ShenandoahControlThread::service_concurrent_normal_cycle(GCCause::Cause cau
326326
ShenandoahConcurrentGC gc(heap->global_generation(), false);
327327
if (gc.collect(cause)) {
328328
// Cycle is complete
329-
heap->global_generation()->heuristics()->record_success_concurrent(gc.abbreviated());
329+
heap->global_generation()->heuristics()->record_success_concurrent();
330330
heap->shenandoah_policy()->record_success_concurrent(false, gc.abbreviated());
331331
heap->log_heap_status("At end of GC");
332332
} else {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,6 @@ void ShenandoahGeneration::decrease_capacity(size_t decrement) {
10091009
}
10101010

10111011
void ShenandoahGeneration::record_success_concurrent(bool abbreviated) {
1012-
heuristics()->record_success_concurrent(abbreviated);
1012+
heuristics()->record_success_concurrent();
10131013
ShenandoahHeap::heap()->shenandoah_policy()->record_success_concurrent(is_young(), abbreviated);
10141014
}

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

+1-1
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

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

0 commit comments

Comments
 (0)
Please sign in to comment.