RFR (S) 8245812: Shenandoah: compute root phase parallelism

Zhengyu Gu zgu at redhat.com
Tue May 26 18:00:32 UTC 2020


Looks good.

-Zhengyu

On 5/26/20 1:50 PM, Aleksey Shipilev wrote:
> On 5/26/20 4:40 PM, Aleksey Shipilev wrote:
>> RFE:
>>    https://bugs.openjdk.java.net/browse/JDK-8245812
>>
>> Current gc+stats log says:
>>
>> [gc,stats] All times are wall-clock times, except per-root-class counters, that are sum over
>> [gc,stats] all workers. Dividing the <total> over the root stage time estimates parallelism.
>>
>> But we can actually compute it ourselves:
> 
> Actually, should test for (total > 0), on the off-chance it is uninitialized:
> 
> diff -r 6a562866cbd0 src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp
> --- a/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp        Tue May 26 09:44:17 2020 -0400
> +++ b/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp        Tue May 26 19:49:45 2020 +0200
> @@ -35,10 +35,11 @@
> 
>   #define SHENANDOAH_PHASE_NAME_FORMAT "%-28s"
>   #define SHENANDOAH_S_TIME_FORMAT "%8.3lf"
>   #define SHENANDOAH_US_TIME_FORMAT "%8.0lf"
>   #define SHENANDOAH_US_WORKER_TIME_FORMAT "%3.0lf"
> +#define SHENANDOAH_PARALLELISM_FORMAT "%4.2lf"
> 
>   #define SHENANDOAH_PHASE_DECLARE_NAME(type, title) \
>     title,
> 
>   const char* ShenandoahPhaseTimings::_phase_names[] = {
> @@ -227,10 +228,18 @@
>     out->cr();
>     for (uint i = 0; i < _num_phases; i++) {
>       double v = _cycle_data[i] * 1000000.0;
>       if (v > 0) {
>         out->print(SHENANDOAH_PHASE_NAME_FORMAT " " SHENANDOAH_US_TIME_FORMAT " us", _phase_names[i], v);
> +
> +      if (is_worker_phase(Phase(i))) {
> +        double total = _cycle_data[i + 1] * 1000000.0;
> +        if (total > 0) {
> +          out->print(", parallelism: " SHENANDOAH_PARALLELISM_FORMAT "x", total / v);
> +        }
> +      }
> +
>         if (_worker_data[i] != NULL) {
>           out->print(", workers (us): ");
>           for (uint c = 0; c < _max_workers; c++) {
>             double tv = _worker_data[i]->get(c);
>             if (tv != ShenandoahWorkerData::uninitialized()) {
> 



More information about the hotspot-gc-dev mailing list