Loop strip mining to decreases safepoint poll frequency

Aleksey Shipilev shade at redhat.com
Thu Mar 2 09:28:50 UTC 2017


On 03/01/2017 04:53 PM, Roland Westrelin wrote:
> 
>>  -UseCLS:         no safepoints, no mining
>>  -UseCLS LSM=0:   no safepoints, no mining
>>  -UseCLS LSM>=1:  illegal?
>>  +UseCLS:         safepoints + mining
>>  +UseCLS LSM=0:   illegal?
>>  +UseCLS LSM=1:   safepoints, but no mining
>>  +UseCLS LSM>=1:  safepoints + mining
> 
> Something like this, then?
> 
> diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp
> --- a/src/share/vm/runtime/arguments.cpp
> +++ b/src/share/vm/runtime/arguments.cpp
> @@ -2630,8 +2630,16 @@
>      }
>      FLAG_SET_CMDLINE(bool, PostLoopMultiversioning, false);
>    }
> -  if (UseCountedLoopSafepoints) {
> +  if (UseCountedLoopSafepoints && LoopStripMiningIter == 0) {
> +    if (!FLAG_IS_DEFAULT(UseCountedLoopSafepoints) && !FLAG_IS_DEFAULT(LoopStripMiningIter)) {
> +      warning("When counted loop safepoints are enabled, LoopStripMiningIter must be at least 1 (a safepoint every 1 iteration): setting it to 1");
> +    }
>      LoopStripMiningIter = 1;
> +  } else if (!UseCountedLoopSafepoints && LoopStripMiningIter > 0) {
> +    if (!FLAG_IS_DEFAULT(UseCountedLoopSafepoints) && !FLAG_IS_DEFAULT(LoopStripMiningIter)) {
> +      warning("Disabling counted safepoints implies no loop strip mining: setting LoopStripMiningIter to 0");
> +    }
> +    LoopStripMiningIter = 0;
>    }
>  #endif
>    return status;

Yes, this sounds right.

Thanks,
-Aleksey



More information about the shenandoah-dev mailing list