Skip to content

Commit ccbb0d8

Browse files
author
William Kemper
committed
8318053: GenShen: Control thread may ignore requests to start concurrent GC
Reviewed-by: kdnilsen, ysr
1 parent 206e5b8 commit ccbb0d8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,7 @@ bool ShenandoahControlThread::check_cancellation_or_degen(ShenandoahGC::Shenando
775775

776776
if (is_alloc_failure_gc()) {
777777
_degen_point = point;
778+
_preemption_requested.unset();
778779
return true;
779780
}
780781

@@ -899,6 +900,10 @@ void ShenandoahControlThread::request_gc(GCCause::Cause cause) {
899900
bool ShenandoahControlThread::request_concurrent_gc(ShenandoahGenerationType generation) {
900901
if (_preemption_requested.is_set() || _gc_requested.is_set() || ShenandoahHeap::heap()->cancelled_gc()) {
901902
// Ignore subsequent requests from the heuristics
903+
log_debug(gc, thread)("Reject request for concurrent gc: preemption_requested: %s, gc_requested: %s, gc_cancelled: %s",
904+
BOOL_TO_STR(_preemption_requested.is_set()),
905+
BOOL_TO_STR(_gc_requested.is_set()),
906+
BOOL_TO_STR(ShenandoahHeap::heap()->cancelled_gc()));
902907
return false;
903908
}
904909

@@ -930,6 +935,9 @@ bool ShenandoahControlThread::request_concurrent_gc(ShenandoahGenerationType gen
930935
return true;
931936
}
932937

938+
log_debug(gc, thread)("Reject request for concurrent gc: mode: %s, allow_old_preemption: %s",
939+
gc_mode_name(gc_mode()),
940+
BOOL_TO_STR(_allow_old_preemption.is_set()));
933941
return false;
934942
}
935943

0 commit comments

Comments
 (0)