--- old/src/hotspot/share/gc/g1/g1ConcurrentMark.hpp 2020-07-03 14:17:55.573802152 +0800 +++ new/src/hotspot/share/gc/g1/g1ConcurrentMark.hpp 2020-07-03 14:17:55.576802247 +0800 @@ -348,7 +348,10 @@ // True: marking is concurrent, false: we're in remark volatile bool _concurrent; // Set at the end of a Full GC so that marking aborts - volatile bool _has_aborted; + volatile bool _aborted_by_fullgc; + // Set at the end of a inital mark young GC if doesn't need to do concurrent mark + // so that marking aborts + volatile bool _aborted_by_initial_mark; // Used when remark aborts due to an overflow to indicate that // another concurrent marking phase should start @@ -509,9 +512,11 @@ void concurrent_cycle_start(); // Abandon current marking iteration due to a Full GC. - void concurrent_cycle_abort(); + void concurrent_cycle_abort_by_fullgc(); void concurrent_cycle_end(); + void concurrent_cycle_abort_by_initial_mark(); + void update_accum_task_vtime(int i, double vtime) { _accum_task_vtime[i] += vtime; } @@ -588,7 +593,9 @@ inline bool do_yield_check(); - bool has_aborted() { return _has_aborted; } + bool aborted_by_fullgc() { return _aborted_by_fullgc; } + bool aborted_by_initial_mark() { return _aborted_by_initial_mark; } + bool has_aborted() { return aborted_by_fullgc() || aborted_by_initial_mark(); } void print_summary_info();