8273605: VM Exit does not abort concurrent mark

Reviewed-by: kbarrett, sjohanss
This commit is contained in:
Thomas Schatzl 2021-09-15 08:27:43 +00:00
parent febcc72a54
commit 02af541b74
3 changed files with 14 additions and 3 deletions

View File

@ -2036,9 +2036,8 @@ void G1ConcurrentMark::concurrent_cycle_abort() {
for (uint i = 0; i < _max_num_tasks; ++i) {
_tasks[i]->clear_region_fields();
}
_first_overflow_barrier_sync.abort();
_second_overflow_barrier_sync.abort();
_has_aborted = true;
abort_marking_threads();
SATBMarkQueueSet& satb_mq_set = G1BarrierSet::satb_mark_queue_set();
satb_mq_set.abandon_partial_marking();
@ -2049,6 +2048,12 @@ void G1ConcurrentMark::concurrent_cycle_abort() {
satb_mq_set.is_active() /* expected_active */);
}
void G1ConcurrentMark::abort_marking_threads() {
_has_aborted = true;
_first_overflow_barrier_sync.abort();
_second_overflow_barrier_sync.abort();
}
static void print_ms_time_info(const char* prefix, const char* name,
NumberSeq& ns) {
log_trace(gc, marking)("%s%5d %12s: total time = %8.2f s (avg = %8.2f ms).",

View File

@ -495,6 +495,10 @@ public:
void concurrent_cycle_abort();
void concurrent_cycle_end();
// Notifies marking threads to abort. This is a best-effort notification. Does not
// guarantee or update any state after the call.
void abort_marking_threads();
void update_accum_task_vtime(int i, double vtime) {
_accum_task_vtime[i] += vtime;
}

View File

@ -159,6 +159,8 @@ void G1ConcurrentMarkThread::run_service() {
}
void G1ConcurrentMarkThread::stop_service() {
_cm->abort_marking_threads();
MutexLocker ml(CGC_lock, Mutex::_no_safepoint_check_flag);
CGC_lock->notify_all();
}