mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8008301: G1: guarantee(satb_mq_set.completed_buffers_num() == 0) failure
If the marking stack overflows while the marking tasks are draining the SATB buffers, remark will exit with some SATB buffers left unprocessed. Relax the guarantee to allow for overflow. Reviewed-by: jmasa, brutisso
This commit is contained in:
parent
9164834d73
commit
a8087d1cb6
1 changed files with 18 additions and 4 deletions
|
@ -1289,12 +1289,22 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) {
|
||||||
if (has_overflown()) {
|
if (has_overflown()) {
|
||||||
// Oops. We overflowed. Restart concurrent marking.
|
// Oops. We overflowed. Restart concurrent marking.
|
||||||
_restart_for_overflow = true;
|
_restart_for_overflow = true;
|
||||||
// Clear the marking state because we will be restarting
|
|
||||||
// marking due to overflowing the global mark stack.
|
|
||||||
reset_marking_state();
|
|
||||||
if (G1TraceMarkStackOverflow) {
|
if (G1TraceMarkStackOverflow) {
|
||||||
gclog_or_tty->print_cr("\nRemark led to restart for overflow.");
|
gclog_or_tty->print_cr("\nRemark led to restart for overflow.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Verify the heap w.r.t. the previous marking bitmap.
|
||||||
|
if (VerifyDuringGC) {
|
||||||
|
HandleMark hm; // handle scope
|
||||||
|
gclog_or_tty->print(" VerifyDuringGC:(overflow)");
|
||||||
|
Universe::heap()->prepare_for_verify();
|
||||||
|
Universe::verify(/* silent */ false,
|
||||||
|
/* option */ VerifyOption_G1UsePrevMarking);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clear the marking state because we will be restarting
|
||||||
|
// marking due to overflowing the global mark stack.
|
||||||
|
reset_marking_state();
|
||||||
} else {
|
} else {
|
||||||
// Aggregate the per-task counting data that we have accumulated
|
// Aggregate the per-task counting data that we have accumulated
|
||||||
// while marking.
|
// while marking.
|
||||||
|
@ -2593,7 +2603,11 @@ void ConcurrentMark::checkpointRootsFinalWork() {
|
||||||
remarkTask.work(0);
|
remarkTask.work(0);
|
||||||
}
|
}
|
||||||
SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set();
|
SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set();
|
||||||
guarantee(satb_mq_set.completed_buffers_num() == 0, "invariant");
|
guarantee(has_overflown() ||
|
||||||
|
satb_mq_set.completed_buffers_num() == 0,
|
||||||
|
err_msg("Invariant: has_overflown = %s, num buffers = %d",
|
||||||
|
BOOL_TO_STR(has_overflown()),
|
||||||
|
satb_mq_set.completed_buffers_num()));
|
||||||
|
|
||||||
print_stats();
|
print_stats();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue