comparison src/share/vm/gc_implementation/g1/concurrentMark.cpp @ 8789:1179172e9ec9

8008301: G1: guarantee(satb_mq_set.completed_buffers_num() == 0) failure Summary: 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
author johnc
date Tue, 19 Mar 2013 09:38:37 -0700
parents e864cc14ca75
children 7b835924c31c
comparison
equal deleted inserted replaced
8788:e864cc14ca75 8789:1179172e9ec9
1287 weakRefsWork(clear_all_soft_refs); 1287 weakRefsWork(clear_all_soft_refs);
1288 1288
1289 if (has_overflown()) { 1289 if (has_overflown()) {
1290 // Oops. We overflowed. Restart concurrent marking. 1290 // Oops. We overflowed. Restart concurrent marking.
1291 _restart_for_overflow = true; 1291 _restart_for_overflow = true;
1292 if (G1TraceMarkStackOverflow) {
1293 gclog_or_tty->print_cr("\nRemark led to restart for overflow.");
1294 }
1295
1296 // Verify the heap w.r.t. the previous marking bitmap.
1297 if (VerifyDuringGC) {
1298 HandleMark hm; // handle scope
1299 gclog_or_tty->print(" VerifyDuringGC:(overflow)");
1300 Universe::heap()->prepare_for_verify();
1301 Universe::verify(/* silent */ false,
1302 /* option */ VerifyOption_G1UsePrevMarking);
1303 }
1304
1292 // Clear the marking state because we will be restarting 1305 // Clear the marking state because we will be restarting
1293 // marking due to overflowing the global mark stack. 1306 // marking due to overflowing the global mark stack.
1294 reset_marking_state(); 1307 reset_marking_state();
1295 if (G1TraceMarkStackOverflow) {
1296 gclog_or_tty->print_cr("\nRemark led to restart for overflow.");
1297 }
1298 } else { 1308 } else {
1299 // Aggregate the per-task counting data that we have accumulated 1309 // Aggregate the per-task counting data that we have accumulated
1300 // while marking. 1310 // while marking.
1301 aggregate_count_data(); 1311 aggregate_count_data();
1302 1312
2591 // concurrent GC thread. 2601 // concurrent GC thread.
2592 CMRemarkTask remarkTask(this, active_workers, true /* is_serial*/); 2602 CMRemarkTask remarkTask(this, active_workers, true /* is_serial*/);
2593 remarkTask.work(0); 2603 remarkTask.work(0);
2594 } 2604 }
2595 SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set(); 2605 SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set();
2596 guarantee(satb_mq_set.completed_buffers_num() == 0, "invariant"); 2606 guarantee(has_overflown() ||
2607 satb_mq_set.completed_buffers_num() == 0,
2608 err_msg("Invariant: has_overflown = %s, num buffers = %d",
2609 BOOL_TO_STR(has_overflown()),
2610 satb_mq_set.completed_buffers_num()));
2597 2611
2598 print_stats(); 2612 print_stats();
2599 } 2613 }
2600 2614
2601 #ifndef PRODUCT 2615 #ifndef PRODUCT