comparison src/share/vm/gc_implementation/g1/concurrentMark.cpp @ 1885:a5c514e74487

6988458: G1: assert(mr.end() <= _cm->finger()) failed: otherwise the region shouldn't be on the stack Summary: The changes from 6941395 did not clear the CMTask::_aborted_region fields when concurrent marking aborted because of overflow. As a result, the next time around we could see a memory region whose start address was above the global finger and the assertion tripped. Moved the clearing of the aborted regions to ConcurrentMark::clear_marking_state, which is executed on all of the exit paths. Reviewed-by: tonyp, ysr, jmasa
author johnc
date Mon, 18 Oct 2010 15:01:41 -0700
parents 4805b9f4779e
children f95d63e2154a
comparison
equal deleted inserted replaced
1884:9f4848ebbabd 1885:a5c514e74487
2416 _finger = _heap_start; 2416 _finger = _heap_start;
2417 2417
2418 for (int i = 0; i < (int)_max_task_num; ++i) { 2418 for (int i = 0; i < (int)_max_task_num; ++i) {
2419 OopTaskQueue* queue = _task_queues->queue(i); 2419 OopTaskQueue* queue = _task_queues->queue(i);
2420 queue->set_empty(); 2420 queue->set_empty();
2421 // Clear any partial regions from the CMTasks
2422 _tasks[i]->clear_aborted_region();
2421 } 2423 }
2422 } 2424 }
2423 2425
2424 void ConcurrentMark::print_stats() { 2426 void ConcurrentMark::print_stats() {
2425 if (verbose_stats()) { 2427 if (verbose_stats()) {
2704 _nextMarkBitMap->clearAll(); 2706 _nextMarkBitMap->clearAll();
2705 // Empty mark stack 2707 // Empty mark stack
2706 clear_marking_state(); 2708 clear_marking_state();
2707 for (int i = 0; i < (int)_max_task_num; ++i) { 2709 for (int i = 0; i < (int)_max_task_num; ++i) {
2708 _tasks[i]->clear_region_fields(); 2710 _tasks[i]->clear_region_fields();
2709 _tasks[i]->clear_aborted_region();
2710 } 2711 }
2711 _has_aborted = true; 2712 _has_aborted = true;
2712 2713
2713 SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set(); 2714 SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set();
2714 satb_mq_set.abandon_partial_marking(); 2715 satb_mq_set.abandon_partial_marking();
2983 if (_cm->verbose_low()) 2984 if (_cm->verbose_low())
2984 gclog_or_tty->print_cr("[%d] resetting", _task_id); 2985 gclog_or_tty->print_cr("[%d] resetting", _task_id);
2985 2986
2986 _nextMarkBitMap = nextMarkBitMap; 2987 _nextMarkBitMap = nextMarkBitMap;
2987 clear_region_fields(); 2988 clear_region_fields();
2988 clear_aborted_region(); 2989 assert(_aborted_region.is_empty(), "should have been cleared");
2989 2990
2990 _calls = 0; 2991 _calls = 0;
2991 _elapsed_time_ms = 0.0; 2992 _elapsed_time_ms = 0.0;
2992 _termination_time_ms = 0.0; 2993 _termination_time_ms = 0.0;
2993 _termination_start_time_ms = 0.0; 2994 _termination_start_time_ms = 0.0;