The fix for JDK-8151336 introduced this code in do_collection_pause_at_safepoint():
// We should not be doing initial mark unless the conc mark thread is running
if (!_cmThread->should_terminate()) {
// This call will decide whether this pause is an initial-mark
// pause. If it is, during_initial_mark_pause() will return true
// for the duration of this pause.
g1_policy()->decide_on_conc_mark_initiation();
}
Ideally the check " if (!_cmThread->should_terminate())" should be inside decide_on_conc_mark_initiation() but G1CollectorPolicy does not know about the concurrent mark thread.
Most of what decide_on_conc_mark_initiation() does is based on the information in G1CollectorState. So, it would be more natural to add a variable in G1CollectorState to keep track of whether or not the concurrent mark thread is still running.
// We should not be doing initial mark unless the conc mark thread is running
if (!_cmThread->should_terminate()) {
// This call will decide whether this pause is an initial-mark
// pause. If it is, during_initial_mark_pause() will return true
// for the duration of this pause.
g1_policy()->decide_on_conc_mark_initiation();
}
Ideally the check " if (!_cmThread->should_terminate())" should be inside decide_on_conc_mark_initiation() but G1CollectorPolicy does not know about the concurrent mark thread.
Most of what decide_on_conc_mark_initiation() does is based on the information in G1CollectorState. So, it would be more natural to add a variable in G1CollectorState to keep track of whether or not the concurrent mark thread is still running.
- duplicates
-
JDK-8271060 Merge G1CollectedHeap::determine_start_concurrent_mark_gc and G1Policy::decide_on_conc_mark_initiation
-
- Resolved
-
- relates to
-
JDK-8151336 Root region scanning should be cancelled and disabled when the ConcurrentMarkThread::run_service() exits
-
- Resolved
-