8232573: Shenandoah: cleanup and add more logging for in-pause phases

Reviewed-by: rkennke
This commit is contained in:
Aleksey Shipilev 2019-10-17 20:56:11 +02:00
parent 86f50ba1ef
commit f630646baf
2 changed files with 48 additions and 26 deletions

View File

@ -1493,31 +1493,36 @@ void ShenandoahHeap::op_final_mark() {
stop_concurrent_marking();
// All allocations past TAMS are implicitly live, adjust the region data.
// Bitmaps/TAMS are swapped at this point, so we need to poll complete bitmap.
{
ShenandoahGCPhase phase(ShenandoahPhaseTimings::complete_liveness);
// All allocations past TAMS are implicitly live, adjust the region data.
// Bitmaps/TAMS are swapped at this point, so we need to poll complete bitmap.
ShenandoahCompleteLivenessClosure cl;
parallel_heap_region_iterate(&cl);
}
// Force the threads to reacquire their TLABs outside the collection set.
{
ShenandoahGCPhase prepare_evac(ShenandoahPhaseTimings::prepare_evac);
ShenandoahGCPhase phase(ShenandoahPhaseTimings::retire_tlabs);
make_parsable(true);
}
// Trash the collection set left over from previous cycle, if any.
{
ShenandoahGCPhase phase(ShenandoahPhaseTimings::trash_cset);
trash_cset_regions();
}
{
ShenandoahHeapLocker locker(lock());
_collection_set->clear();
_free_set->clear();
{
ShenandoahGCPhase phase(ShenandoahPhaseTimings::prepare_evac);
heuristics()->choose_collection_set(_collection_set);
ShenandoahHeapLocker locker(lock());
_collection_set->clear();
_free_set->clear();
_free_set->rebuild();
}
heuristics()->choose_collection_set(_collection_set);
_free_set->rebuild();
}
// If collection set has candidates, start evacuation.
@ -1580,7 +1585,10 @@ void ShenandoahHeap::op_final_evac() {
set_evacuation_in_progress(false);
retire_and_reset_gclabs();
{
ShenandoahGCPhase phase(ShenandoahPhaseTimings::final_evac_retire_gclabs);
retire_and_reset_gclabs();
}
if (ShenandoahVerify) {
verifier()->verify_after_evacuation();
@ -2234,7 +2242,10 @@ void ShenandoahHeap::op_init_updaterefs() {
set_evacuation_in_progress(false);
retire_and_reset_gclabs();
{
ShenandoahGCPhase phase(ShenandoahPhaseTimings::init_update_refs_retire_gclabs);
retire_and_reset_gclabs();
}
if (ShenandoahVerify) {
if (!is_degenerated_gc_in_progress()) {
@ -2244,14 +2255,19 @@ void ShenandoahHeap::op_init_updaterefs() {
}
set_update_refs_in_progress(true);
make_parsable(true);
for (uint i = 0; i < num_regions(); i++) {
ShenandoahHeapRegion* r = get_region(i);
r->set_concurrent_iteration_safe_limit(r->top());
}
// Reset iterator.
_update_refs_iterator.reset();
{
ShenandoahGCPhase phase(ShenandoahPhaseTimings::init_update_refs_prepare);
make_parsable(true);
for (uint i = 0; i < num_regions(); i++) {
ShenandoahHeapRegion* r = get_region(i);
r->set_concurrent_iteration_safe_limit(r->top());
}
// Reset iterator.
_update_refs_iterator.reset();
}
if (ShenandoahPacing) {
pacer()->setup_for_updaterefs();
@ -2263,7 +2279,7 @@ void ShenandoahHeap::op_final_updaterefs() {
// Check if there is left-over work, and finish it
if (_update_refs_iterator.has_next()) {
ShenandoahGCPhase final_work(ShenandoahPhaseTimings::final_update_refs_finish_work);
ShenandoahGCPhase phase(ShenandoahPhaseTimings::final_update_refs_finish_work);
// Finish updating references where we left off.
clear_cancelled_gc();
@ -2292,9 +2308,11 @@ void ShenandoahHeap::op_final_updaterefs() {
verifier()->verify_roots_in_to_space();
}
ShenandoahGCPhase final_update_refs(ShenandoahPhaseTimings::final_update_refs_recycle);
{
ShenandoahGCPhase phase(ShenandoahPhaseTimings::final_update_refs_trash_cset);
trash_cset_regions();
}
trash_cset_regions();
set_has_forwarded_objects(false);
set_update_refs_in_progress(false);

View File

@ -100,8 +100,9 @@ class outputStream;
f(purge_par, " Parallel Cleanup") \
f(purge_cldg, " CLDG") \
f(complete_liveness, " Complete Liveness") \
f(retire_tlabs, " Retire TLABs") \
f(trash_cset, " Trash CSet") \
f(prepare_evac, " Prepare Evacuation") \
f(recycle_regions, " Recycle regions") \
\
/* Per-thread timer block, should have "roots" counters in consistent order */ \
f(init_evac, " Initial Evacuation") \
@ -127,9 +128,12 @@ class outputStream;
\
f(final_evac_gross, "Pause Final Evac (G)") \
f(final_evac, "Pause Final Evac (N)") \
f(final_evac_retire_gclabs, " Retire GCLABs") \
\
f(init_update_refs_gross, "Pause Init Update Refs (G)") \
f(init_update_refs, "Pause Init Update Refs (N)") \
f(init_update_refs_retire_gclabs, " Retire GCLABs") \
f(init_update_refs_prepare, " Prepare") \
\
f(final_update_refs_gross, "Pause Final Update Refs (G)") \
f(final_update_refs, "Pause Final Update Refs (N)") \
@ -157,7 +161,7 @@ class outputStream;
f(final_update_refs_string_dedup_queue_roots, " UR: Dedup Queue Roots") \
f(final_update_refs_finish_queues, " UR: Finish Queues") \
\
f(final_update_refs_recycle, " Recycle") \
f(final_update_refs_trash_cset, " Trash CSet") \
\
f(degen_gc_gross, "Pause Degenerated GC (G)") \
f(degen_gc, "Pause Degenerated GC (N)") \