From 4b5cd0ecb1cff69fe9263b8e74020190dd0898d2 Mon Sep 17 00:00:00 2001 From: anoll Date: Mon, 14 Apr 2014 08:24:28 +0200 Subject: [PATCH] 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 --- src/share/vm/runtime/advancedThresholdPolicy.cpp | 3 ++- src/share/vm/runtime/arguments.cpp | 4 ++++ src/share/vm/runtime/compilationPolicy.cpp | 1 + src/share/vm/runtime/simpleThresholdPolicy.cpp | 3 ++- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/share/vm/runtime/advancedThresholdPolicy.cpp b/src/share/vm/runtime/advancedThresholdPolicy.cpp index 7d72ca7f3..1680c48e9 100644 --- a/src/share/vm/runtime/advancedThresholdPolicy.cpp +++ b/src/share/vm/runtime/advancedThresholdPolicy.cpp @@ -53,7 +53,8 @@ void AdvancedThresholdPolicy::initialize() { } 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 diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp index 7441f2610..b859c15af 100644 --- a/src/share/vm/runtime/arguments.cpp +++ b/src/share/vm/runtime/arguments.cpp @@ -2383,6 +2383,10 @@ bool Arguments::check_vm_args_consistency() { status &= verify_interval(NmethodSweepFraction, 1, ReservedCodeCacheSize/K, "NmethodSweepFraction"); status &= verify_interval(NmethodSweepActivity, 0, 2000, "NmethodSweepActivity"); + if (!FLAG_IS_DEFAULT(CICompilerCount) && !FLAG_IS_DEFAULT(CICompilerCountPerCPU) && CICompilerCountPerCPU) { + warning("The VM option CICompilerCountPerCPU overrides CICompilerCount."); + } + return status; } diff --git a/src/share/vm/runtime/compilationPolicy.cpp b/src/share/vm/runtime/compilationPolicy.cpp index 23fbc87f7..3431f3cc3 100644 --- a/src/share/vm/runtime/compilationPolicy.cpp +++ b/src/share/vm/runtime/compilationPolicy.cpp @@ -182,6 +182,7 @@ void NonTieredCompPolicy::initialize() { // 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; } diff --git a/src/share/vm/runtime/simpleThresholdPolicy.cpp b/src/share/vm/runtime/simpleThresholdPolicy.cpp index ad4c27cf2..1e78f215d 100644 --- a/src/share/vm/runtime/simpleThresholdPolicy.cpp +++ b/src/share/vm/runtime/simpleThresholdPolicy.cpp @@ -142,7 +142,8 @@ void SimpleThresholdPolicy::initialize() { 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) { -- GitLab