[9] RFR(S): 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags

Tobias Hartmann tobias.hartmann at oracle.com
Tue Aug 2 12:30:51 UTC 2016


Hi,

please review the following patch:
https://bugs.openjdk.java.net/browse/JDK-8162881
http://cr.openjdk.java.net/~thartmann/8162881/webrev.00/

There are multiple problems and inconsistencies with the CICompilerCount flag:

1) We can not set the number of compiler threads to 1 if -TieredCompilation is specified after CICompilerCount=1:
 $ java -XX:CICompilerCount=1 -XX:-TieredCompilation -version
 CICompilerCount (1) must be at least 2 
 Improperly specified VM option 'CICompilerCount=1'
 Error: Could not create the Java Virtual Machine.
 Error: A fatal exception has occurred. Program will exit.

2) We can not set the number of compiler threads to 1 if TieredStopAtLevel=1 is specified after CICompilerCount=1:
 $ java -XX:CICompilerCount=1 -XX:-TieredStopAtLevel=1 -XX:+PrintFlagsFinal -version
 CICompilerCount (1) must be at least 2
 Improperly specified VM option 'CICompilerCount=1'
 Error: Could not create the Java Virtual Machine.
 Error: A fatal exception has occurred. Program will exit.

3) The number of compiler counts can be set to 1 with TieredStopAtLevel=1 but has no effect:
 $ java -XX:TieredStopAtLevel=1 -XX:CICompilerCount=1 -XX:+PrintFlagsFinal -version | grep CICompilerCount
      intx CICompilerCount                          = 2                                        {product} {command line, ergonomic}

4) The value of CICompilerCount is listed as being "ergonomic" although it was set via command line:
 $ java -XX:TieredStopAtLevel=1 -XX:CICompilerCount=5 -XX:+PrintFlagsFinal -version | grep CICompilerCount
     intx CICompilerCount                          = 5                                        {product} {command line, ergonomic}

To fix 1) and 2), I changed the ConstraintType of the CICompilerCount constraint to 'AfterErgo'. Like this, the value of CICompilerCount is only checked after the effect of -XX:-TieredCompilation took place.

To fix 3), I added special cases to the initialization of SimpleThresholdPolicy and AdvancedThresholdPolicy to set the C2 compiler count to zero if TieredStopAtLevel < CompLevel_full_optimization.

To fix 4), I changed the ergonomics code to only use FLAG_SET_ERGO if the value of CICompilerCount is updated. I also changed the computation of 'count' to always be >= 2 because with os::active_processor_count() == 1, count is ergonomically set to 1 but both c1_count and c2_count are set to 2. I added an assert to check for consistency.

I added the corresponding test cases to CheckCICompilerCount.

Tested with regression test, JPRT and RBT (running).

Thanks,
Tobias


More information about the hotspot-compiler-dev mailing list