8029436: CICompilerCount is not updated when the number of compiler threads is adjusted to the number of CPUs

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
This commit is contained in:
Tobias Hartmann 2014-04-14 08:24:28 +02:00 committed by Albert Noll
parent 7e1059b62d
commit e4fc75979e
4 changed files with 9 additions and 2 deletions

View file

@ -53,7 +53,8 @@ void AdvancedThresholdPolicy::initialize() {
} }
set_c1_count(MAX2(count / 3, 1)); 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 // Some inlining tuning
#ifdef X86 #ifdef X86

View file

@ -2410,6 +2410,10 @@ bool Arguments::check_vm_args_consistency() {
const int num_min_compiler_threads = (TieredCompilation && (TieredStopAtLevel >= CompLevel_full_optimization)) ? 2 : 1; const int num_min_compiler_threads = (TieredCompilation && (TieredStopAtLevel >= CompLevel_full_optimization)) ? 2 : 1;
status &=verify_min_value(CICompilerCount, num_min_compiler_threads, "CICompilerCount"); 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; return status;
} }

View file

@ -182,6 +182,7 @@ void NonTieredCompPolicy::initialize() {
// max(log2(8)-1,1) = 2 compiler threads on an 8-way machine. // max(log2(8)-1,1) = 2 compiler threads on an 8-way machine.
// May help big-app startup time. // May help big-app startup time.
_compiler_count = MAX2(log2_intptr(os::active_processor_count())-1,1); _compiler_count = MAX2(log2_intptr(os::active_processor_count())-1,1);
FLAG_SET_ERGO(intx, CICompilerCount, _compiler_count);
} else { } else {
_compiler_count = CICompilerCount; _compiler_count = CICompilerCount;
} }

View file

@ -142,7 +142,8 @@ void SimpleThresholdPolicy::initialize() {
count = MAX2(log2_intptr(os::active_processor_count()), 1) * 3 / 2; count = MAX2(log2_intptr(os::active_processor_count()), 1) * 3 / 2;
} }
set_c1_count(MAX2(count / 3, 1)); 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) { void SimpleThresholdPolicy::set_carry_if_necessary(InvocationCounter *counter) {