Integrated: JDK-8283807: Handle CompileThreshold the same as other thresholds when scaled with -XX:CompileThresholdScaling

Tobias Holenstein duke at openjdk.java.net
Fri May 6 07:11:54 UTC 2022


On Mon, 2 May 2022 13:17:49 GMT, Tobias Holenstein <duke at openjdk.java.net> wrote:

> `CompileThresholdScaling` scales several compiler thresholds. If the scaled threshold value is outside of the allowed range, a warning is printed and the default value is kept. But when scaling `CompileThreshold` we do not check the scaled value because it is not a ranged flag. Later when verifying flags with a constraint function `OnStackReplacePercentageConstraintFunc` which calls `CompileThresholdConstraintFunc` fails because `CompileThreshold` is outside of the allowed range. This stops the VM from being created. 
> 
> The fix is to call `CompileThresholdConstraintFunc` when scaling `CompileThreshold` with `CompileThresholdScaling`. If `CompileThresholdConstraintFunc` fails we print a warning and keep the default value of `CompileThreshold`. This behaviour is then consistent with the other 15 other thresholds where the VM just prints a warning if the scaled value is too large and then keeps the current value.
> 
> We also have to exclude `CompileThresholdScaling` from max. range testing in `TestOptionsWithRanges.java`, because
> it is expected to print "outside the allowed range" warnings for the scaled flag and the "outside the allowed range" warning does not refer to `CompileThresholdScaling` itself. 
> 
> One question that remains it why `CompileThresholdScaling` takes the default value when a scaled threshold is too large instead of the max. value?  Because now we can have the case where some compiler thresholds are scaled to almost their max. value and others that are already larger than the maximum are default again (which can be the minimum value in some cases). I suggest to address this issue in a separate RFE.

This pull request has now been integrated.

Changeset: dd06cc63
Author:    Tobias Holenstein <tobias.holenstein at oracle.com>
Committer: Tobias Hartmann <thartmann at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/dd06cc638ec54e54cce599f82f37eb56abac2eae
Stats:     89 lines in 4 files changed: 84 ins; 3 del; 2 mod

8283807: Handle CompileThreshold the same as other thresholds when scaled with -XX:CompileThresholdScaling

Reviewed-by: kvn, iklam, thartmann

-------------

PR: https://git.openjdk.java.net/jdk/pull/8501


More information about the hotspot-dev mailing list