Skip to content
Permalink
Browse files

8242089: Shenandoah: per-worker stats should be summed up, not averaged

Reviewed-by: rkennke
  • Loading branch information
shipilev committed Apr 3, 2020
1 parent 21d5f88 commit c09b0a7793f6b7aff659564e1d3678549b813018
@@ -87,11 +87,13 @@ void ShenandoahPhaseTimings::record_workers_end(Phase phase) {
phase == _num_phases,
"only in these phases we can add per-thread phase times");
if (phase != _num_phases) {
// Merge _phase_time to counters below the given phase.
for (uint i = 0; i < GCParPhasesSentinel; i++) {
double t = _gc_par_phases[i]->average();
_timing_data[phase + i + 1].add(t);
double s = 0;
for (uint i = 1; i < GCParPhasesSentinel; i++) {
double t = _gc_par_phases[i]->sum();
_timing_data[phase + i + 1].add(t); // add to each line in phase
s += t;
}
_timing_data[phase + 1].add(s); // add to total for phase
}
}

@@ -104,6 +106,9 @@ void ShenandoahPhaseTimings::print_on(outputStream* out) const {
out->print_cr(" \"a\" is average time for each phase, look at levels to see if average makes sense.");
out->print_cr(" \"lvls\" are quantiles: 0%% (minimum), 25%%, 50%% (median), 75%%, 100%% (maximum).");
out->cr();
out->print_cr(" All times are wall-clock times, except per-root-class counters, that are sum over");
out->print_cr(" all workers. Dividing the <total> over the root stage time estimates parallelism.");
out->cr();

for (uint i = 0; i < _num_phases; i++) {
if (_timing_data[i].maximum() != 0) {
@@ -34,6 +34,7 @@ class ShenandoahCollectorPolicy;
class outputStream;

#define SHENANDOAH_GC_PAR_PHASE_DO(CNT_PREFIX, DESC_PREFIX, f) \
f(CNT_PREFIX ## TotalWork, DESC_PREFIX "<total>") \
f(CNT_PREFIX ## ThreadRoots, DESC_PREFIX "Thread Roots") \
f(CNT_PREFIX ## CodeCacheRoots, DESC_PREFIX "Code Cache Roots") \
f(CNT_PREFIX ## UniverseRoots, DESC_PREFIX "Universe Roots") \

0 comments on commit c09b0a7

Please sign in to comment.