Skip to content

Commit

Permalink
8336742: Shenandoah: Add more verbose logging/stats for mark terminat…
Browse files Browse the repository at this point in the history
…ion attempts
  • Loading branch information
neethu-prasad committed Jul 24, 2024
1 parent c25c489 commit 7c3d4a8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ void ShenandoahConcurrentMark::concurrent_mark() {

ShenandoahSATBMarkQueueSet& qset = ShenandoahBarrierSet::satb_mark_queue_set();
ShenandoahFlushSATBHandshakeClosure flush_satb(qset);
for (uint flushes = 0; flushes < ShenandoahMaxSATBBufferFlushes; flushes++) {
double handshake_total_time = 0;
uint flushes;
for (flushes = 0; flushes < ShenandoahMaxSATBBufferFlushes; flushes++) {
TaskTerminator terminator(nworkers, task_queues());
ShenandoahConcurrentMarkingTask<NON_GEN> task(this, &terminator);
workers->run_task(&task);
Expand All @@ -216,14 +218,20 @@ void ShenandoahConcurrentMark::concurrent_mark() {
}

size_t before = qset.completed_buffers_num();
double handshake_start_time = os::elapsedTime();
Handshake::execute(&flush_satb);
handshake_total_time += os::elapsedTime() - handshake_start_time;
size_t after = qset.completed_buffers_num();

if (before == after) {
// No more retries needed, break out.
break;
}
}
ShenandoahPhaseTimings* const timings = heap->phase_timings();
timings->record_phase_time(ShenandoahPhaseTimings::conc_mark_satb_flush_rendezvous, handshake_total_time);

log_info(gc, phases) ("Total SATB flush attempts : %d", (flushes + 1));
assert(task_queues()->is_empty() || heap->cancelled_gc(), "Should be empty when not cancelled");
}

Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class outputStream;
f(conc_mark_roots, "Concurrent Mark Roots ") \
SHENANDOAH_PAR_PHASE_DO(conc_mark_roots, " CMR: ", f) \
f(conc_mark, "Concurrent Marking") \
f(conc_mark_satb_flush_rendezvous, " SATB Flush Rendezvous") \
\
f(final_mark_gross, "Pause Final Mark (G)") \
f(final_mark, "Pause Final Mark (N)") \
Expand Down

0 comments on commit 7c3d4a8

Please sign in to comment.