8029436: CICompilerCount is not updated when the number of compiler threads is adjusted to the number of CPUs
authoranoll
Mon, 14 Apr 2014 08:24:28 +0200
changeset 24013 1d16b0f1060d
parent 24009 ec494183af7e
child 24014 b4a5c7518203
8029436: CICompilerCount is not updated when the number of compiler threads is adjusted to the number of CPUs Summary: CICompilerCount is updated in AdvancedThresholdPolicy::initialize, SimpleThresholdPolicy::initialize and NonTieredCompPolicy::initialize. A warning is printed if the usersets both, CICompilerCount and CICompilerCountPerCPU. Reviewed-by: kvn, twisti Contributed-by: Tobias Hartmann <tobias.hartmann@oracle.com>
hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp
hotspot/src/share/vm/runtime/arguments.cpp
hotspot/src/share/vm/runtime/compilationPolicy.cpp
hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp
--- a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp	Fri Apr 11 11:33:00 2014 +0200
+++ b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp	Mon Apr 14 08:24:28 2014 +0200
@@ -53,7 +53,8 @@
   }
 
   set_c1_count(MAX2(count / 3, 1));
-  set_c2_count(MAX2(count - count / 3, 1));
+  set_c2_count(MAX2(count - c1_count(), 1));
+  FLAG_SET_ERGO(intx, CICompilerCount, c1_count() + c2_count());
 
   // Some inlining tuning
 #ifdef X86
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Fri Apr 11 11:33:00 2014 +0200
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Mon Apr 14 08:24:28 2014 +0200
@@ -2410,6 +2410,10 @@
   const int num_min_compiler_threads = (TieredCompilation && (TieredStopAtLevel >= CompLevel_full_optimization)) ? 2 : 1;
   status &=verify_min_value(CICompilerCount, num_min_compiler_threads, "CICompilerCount");
 
+  if (!FLAG_IS_DEFAULT(CICompilerCount) && !FLAG_IS_DEFAULT(CICompilerCountPerCPU) && CICompilerCountPerCPU) {
+    warning("The VM option CICompilerCountPerCPU overrides CICompilerCount.");
+  }
+
   return status;
 }
 
--- a/hotspot/src/share/vm/runtime/compilationPolicy.cpp	Fri Apr 11 11:33:00 2014 +0200
+++ b/hotspot/src/share/vm/runtime/compilationPolicy.cpp	Mon Apr 14 08:24:28 2014 +0200
@@ -182,6 +182,7 @@
     // max(log2(8)-1,1) = 2 compiler threads on an 8-way machine.
     // May help big-app startup time.
     _compiler_count = MAX2(log2_intptr(os::active_processor_count())-1,1);
+    FLAG_SET_ERGO(intx, CICompilerCount, _compiler_count);
   } else {
     _compiler_count = CICompilerCount;
   }
--- a/hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp	Fri Apr 11 11:33:00 2014 +0200
+++ b/hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp	Mon Apr 14 08:24:28 2014 +0200
@@ -142,7 +142,8 @@
     count = MAX2(log2_intptr(os::active_processor_count()), 1) * 3 / 2;
   }
   set_c1_count(MAX2(count / 3, 1));
-  set_c2_count(MAX2(count - count / 3, 1));
+  set_c2_count(MAX2(count - c1_count(), 1));
+  FLAG_SET_ERGO(intx, CICompilerCount, c1_count() + c2_count());
 }
 
 void SimpleThresholdPolicy::set_carry_if_necessary(InvocationCounter *counter) {