8243495: Shenandoah: print root statistics for concurrent weak/strong root phases

Reviewed-by: rkennke
This commit is contained in:
Aleksey Shipilev 2020-04-30 18:05:55 +02:00
parent 38e6f3665c
commit 7f877f6384
4 changed files with 11 additions and 13 deletions

View File

@ -2882,6 +2882,7 @@ void ShenandoahHeap::entry_weak_roots() {
EventMark em("%s", msg); EventMark em("%s", msg);
ShenandoahGCPhase phase(ShenandoahPhaseTimings::conc_weak_roots); ShenandoahGCPhase phase(ShenandoahPhaseTimings::conc_weak_roots);
ShenandoahGCWorkerPhase worker_phase(ShenandoahPhaseTimings::conc_weak_roots);
ShenandoahWorkerScope scope(workers(), ShenandoahWorkerScope scope(workers(),
ShenandoahWorkerPolicy::calc_workers_for_conc_root_processing(), ShenandoahWorkerPolicy::calc_workers_for_conc_root_processing(),
@ -2912,6 +2913,7 @@ void ShenandoahHeap::entry_strong_roots() {
EventMark em("%s", msg); EventMark em("%s", msg);
ShenandoahGCPhase phase(ShenandoahPhaseTimings::conc_strong_roots); ShenandoahGCPhase phase(ShenandoahPhaseTimings::conc_strong_roots);
ShenandoahGCWorkerPhase worker_phase(ShenandoahPhaseTimings::conc_strong_roots);
ShenandoahWorkerScope scope(workers(), ShenandoahWorkerScope scope(workers(),
ShenandoahWorkerPolicy::calc_workers_for_conc_root_processing(), ShenandoahWorkerPolicy::calc_workers_for_conc_root_processing(),

View File

@ -107,6 +107,8 @@ bool ShenandoahPhaseTimings::is_worker_phase(Phase phase) {
case purge_class_unload: case purge_class_unload:
case purge_weak_par: case purge_weak_par:
case heap_iteration_roots: case heap_iteration_roots:
case conc_weak_roots:
case conc_strong_roots:
return true; return true;
default: default:
return false; return false;

View File

@ -91,9 +91,11 @@ class outputStream;
SHENANDOAH_PAR_PHASE_DO(evac_, " E: ", f) \ SHENANDOAH_PAR_PHASE_DO(evac_, " E: ", f) \
\ \
f(conc_weak_roots, "Concurrent Weak Roots") \ f(conc_weak_roots, "Concurrent Weak Roots") \
SHENANDOAH_PAR_PHASE_DO(conc_weak_roots_, " CWR: ", f) \
f(conc_cleanup_early, "Concurrent Cleanup") \ f(conc_cleanup_early, "Concurrent Cleanup") \
f(conc_class_unloading, "Concurrent Class Unloading") \ f(conc_class_unloading, "Concurrent Class Unloading") \
f(conc_strong_roots, "Concurrent Strong Roots") \ f(conc_strong_roots, "Concurrent Strong Roots") \
SHENANDOAH_PAR_PHASE_DO(conc_strong_roots_, " CSR: ", f) \
f(conc_evac, "Concurrent Evacuation") \ f(conc_evac, "Concurrent Evacuation") \
\ \
f(init_update_refs_gross, "Pause Init Update Refs (G)") \ f(init_update_refs_gross, "Pause Init Update Refs (G)") \

View File

@ -48,12 +48,8 @@ inline ShenandoahVMRoot<CONCURRENT>::ShenandoahVMRoot(OopStorage* storage,
template <bool CONCURRENT> template <bool CONCURRENT>
template <typename Closure> template <typename Closure>
inline void ShenandoahVMRoot<CONCURRENT>::oops_do(Closure* cl, uint worker_id) { inline void ShenandoahVMRoot<CONCURRENT>::oops_do(Closure* cl, uint worker_id) {
if (CONCURRENT) { ShenandoahWorkerTimingsTracker timer(_phase, _par_phase, worker_id);
_itr.oops_do(cl); _itr.oops_do(cl);
} else {
ShenandoahWorkerTimingsTracker timer(_phase, _par_phase, worker_id);
_itr.oops_do(cl);
}
} }
template <bool CONCURRENT> template <bool CONCURRENT>
@ -149,11 +145,9 @@ void ShenandoahClassLoaderDataRoots<CONCURRENT, SINGLE_THREADED>::always_strong_
assert(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint"); assert(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint");
assert(Thread::current()->is_VM_thread(), "Single threaded CLDG iteration can only be done by VM thread"); assert(Thread::current()->is_VM_thread(), "Single threaded CLDG iteration can only be done by VM thread");
ClassLoaderDataGraph::always_strong_cld_do(clds); ClassLoaderDataGraph::always_strong_cld_do(clds);
} else if (CONCURRENT) {
ClassLoaderDataGraph::always_strong_cld_do(clds);
} else { } else {
ShenandoahWorkerTimingsTracker timer(_phase, ShenandoahPhaseTimings::CLDGRoots, worker_id); ShenandoahWorkerTimingsTracker timer(_phase, ShenandoahPhaseTimings::CLDGRoots, worker_id);
ClassLoaderDataGraph::always_strong_cld_do(clds); ClassLoaderDataGraph::always_strong_cld_do(clds);
} }
} }
@ -163,9 +157,7 @@ void ShenandoahClassLoaderDataRoots<CONCURRENT, SINGLE_THREADED>::cld_do(CLDClos
assert(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint"); assert(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint");
assert(Thread::current()->is_VM_thread(), "Single threaded CLDG iteration can only be done by VM thread"); assert(Thread::current()->is_VM_thread(), "Single threaded CLDG iteration can only be done by VM thread");
ClassLoaderDataGraph::cld_do(clds); ClassLoaderDataGraph::cld_do(clds);
} else if (CONCURRENT) { } else {
ClassLoaderDataGraph::cld_do(clds);
} else {
ShenandoahWorkerTimingsTracker timer(_phase, ShenandoahPhaseTimings::CLDGRoots, worker_id); ShenandoahWorkerTimingsTracker timer(_phase, ShenandoahPhaseTimings::CLDGRoots, worker_id);
ClassLoaderDataGraph::cld_do(clds); ClassLoaderDataGraph::cld_do(clds);
} }