Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9751b8f

Browse files
committed
8273614: Shenandoah: intermittent timeout with ConcurrentGCBreakpoint tests
Backport-of: 3f07337722a0c8c6b452a44745598268d67c0864
1 parentaabc4ba commit9751b8f

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

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

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,24 +50,37 @@
5050

5151
// Breakpoint support
5252
classShenandoahBreakpointGCScope :publicStackObj {
53+
private:
54+
const GCCause::Cause _cause;
5355
public:
54-
ShenandoahBreakpointGCScope() {
55-
ShenandoahBreakpoint::at_before_gc();
56+
ShenandoahBreakpointGCScope(GCCause::Cause cause) : _cause(cause) {
57+
if (cause == GCCause::_wb_breakpoint) {
58+
ShenandoahBreakpoint::start_gc();
59+
ShenandoahBreakpoint::at_before_gc();
60+
}
5661
}
5762

5863
~ShenandoahBreakpointGCScope() {
59-
ShenandoahBreakpoint::at_after_gc();
64+
if (_cause == GCCause::_wb_breakpoint) {
65+
ShenandoahBreakpoint::at_after_gc();
66+
}
6067
}
6168
};
6269

6370
classShenandoahBreakpointMarkScope :publicStackObj {
71+
private:
72+
const GCCause::Cause _cause;
6473
public:
65-
ShenandoahBreakpointMarkScope() {
66-
ShenandoahBreakpoint::at_after_marking_started();
74+
ShenandoahBreakpointMarkScope(GCCause::Cause cause) : _cause(cause) {
75+
if (_cause == GCCause::_wb_breakpoint) {
76+
ShenandoahBreakpoint::at_after_marking_started();
77+
}
6778
}
6879

6980
~ShenandoahBreakpointMarkScope() {
70-
ShenandoahBreakpoint::at_before_marking_completed();
81+
if (_cause == GCCause::_wb_breakpoint) {
82+
ShenandoahBreakpoint::at_before_marking_completed();
83+
}
7184
}
7285
};
7386

@@ -86,10 +99,7 @@ void ShenandoahConcurrentGC::cancel() {
8699

87100
boolShenandoahConcurrentGC::collect(GCCause::Cause cause) {
88101
ShenandoahHeap*const heap =ShenandoahHeap::heap();
89-
if (cause == GCCause::_wb_breakpoint) {
90-
ShenandoahBreakpoint::start_gc();
91-
}
92-
ShenandoahBreakpointGCScope breakpoint_gc_scope;
102+
ShenandoahBreakpointGCScopebreakpoint_gc_scope(cause);
93103

94104
// Reset for upcoming marking
95105
entry_reset();
@@ -98,7 +108,7 @@ bool ShenandoahConcurrentGC::collect(GCCause::Cause cause) {
98108
vmop_entry_init_mark();
99109

100110
{
101-
ShenandoahBreakpointMarkScope breakpoint_mark_scope;
111+
ShenandoahBreakpointMarkScopebreakpoint_mark_scope(cause);
102112
// Concurrent mark roots
103113
entry_mark_roots();
104114
if (check_cancellation_and_abort(ShenandoahDegenPoint::_degenerated_outside_cycle))returnfalse;
@@ -657,7 +667,9 @@ void ShenandoahConcurrentGC::op_weak_refs() {
657667
assert(heap->is_concurrent_weak_root_in_progress(),"Only during this phase");
658668
// Concurrent weak refs processing
659669
ShenandoahGCWorkerPhaseworker_phase(ShenandoahPhaseTimings::conc_weak_refs);
660-
ShenandoahBreakpoint::at_after_reference_processing_started();
670+
if (heap->gc_cause() == GCCause::_wb_breakpoint) {
671+
ShenandoahBreakpoint::at_after_reference_processing_started();
672+
}
661673
heap->ref_processor()->process_references(ShenandoahPhaseTimings::conc_weak_refs, heap->workers(),true/* concurrent*/);
662674
}
663675

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp