8293019: [JVMCI] change ratio of libgraal to C1 threads and use one isolate per libgraal thread

Reviewed-by: never, iveresov
This commit is contained in:
Doug Simon 2022-08-31 16:13:25 +00:00
parent 0d51f63a2e
commit 3c1bda4bc3
3 changed files with 23 additions and 5 deletions

View File

@ -485,8 +485,18 @@ void CompilationPolicy::initialize() {
} else if (c2_only) { } else if (c2_only) {
set_c2_count(count); set_c2_count(count);
} else { } else {
set_c1_count(MAX2(count / 3, 1)); #if INCLUDE_JVMCI
set_c2_count(MAX2(count - c1_count(), 1)); if (UseJVMCICompiler && UseJVMCINativeLibrary) {
int libjvmci_count = MAX2((int) (count * JVMCINativeLibraryThreadFraction), 1);
int c1_count = MAX2(count - libjvmci_count, 1);
set_c2_count(libjvmci_count);
set_c1_count(c1_count);
} else
#endif
{
set_c1_count(MAX2(count / 3, 1));
set_c2_count(MAX2(count - c1_count(), 1));
}
} }
assert(count == c1_count() + c2_count(), "inconsistent compiler thread count"); assert(count == c1_count() + c2_count(), "inconsistent compiler thread count");
set_increase_threshold_at_ratio(); set_increase_threshold_at_ratio();

View File

@ -122,6 +122,7 @@ bool JVMCIGlobals::check_jvmci_flags_are_consistent() {
CHECK_NOT_SET(JVMCIThreadsPerNativeLibraryRuntime, EnableJVMCI) CHECK_NOT_SET(JVMCIThreadsPerNativeLibraryRuntime, EnableJVMCI)
CHECK_NOT_SET(JVMCICompilerIdleDelay, EnableJVMCI) CHECK_NOT_SET(JVMCICompilerIdleDelay, EnableJVMCI)
CHECK_NOT_SET(UseJVMCINativeLibrary, EnableJVMCI) CHECK_NOT_SET(UseJVMCINativeLibrary, EnableJVMCI)
CHECK_NOT_SET(JVMCINativeLibraryThreadFraction, EnableJVMCI)
CHECK_NOT_SET(JVMCILibPath, EnableJVMCI) CHECK_NOT_SET(JVMCILibPath, EnableJVMCI)
CHECK_NOT_SET(JVMCINativeLibraryErrorFile, EnableJVMCI) CHECK_NOT_SET(JVMCINativeLibraryErrorFile, EnableJVMCI)
CHECK_NOT_SET(JVMCILibDumpJNIConfig, EnableJVMCI) CHECK_NOT_SET(JVMCILibDumpJNIConfig, EnableJVMCI)
@ -181,6 +182,7 @@ bool JVMCIGlobals::enable_jvmci_product_mode(JVMFlagOrigin origin) {
"JVMCILibPath", "JVMCILibPath",
"JVMCILibDumpJNIConfig", "JVMCILibDumpJNIConfig",
"UseJVMCINativeLibrary", "UseJVMCINativeLibrary",
"JVMCINativeLibraryThreadFraction",
"JVMCINativeLibraryErrorFile", "JVMCINativeLibraryErrorFile",
NULL NULL
}; };

View File

@ -58,9 +58,10 @@ class fileStream;
"Use JVMCI as the default compiler. Defaults to true if " \ "Use JVMCI as the default compiler. Defaults to true if " \
"EnableJVMCIProduct is true.") \ "EnableJVMCIProduct is true.") \
\ \
product(uint, JVMCIThreadsPerNativeLibraryRuntime, 0, EXPERIMENTAL, \ product(uint, JVMCIThreadsPerNativeLibraryRuntime, 1, EXPERIMENTAL, \
"Max number of threads per JVMCI native runtime. " \ "Max number of threads per JVMCI native runtime. " \
"Specify 0 to force use of a single JVMCI native runtime. ") \ "Specify 0 to force use of a single JVMCI native runtime. " \
"Specify 1 to force a single JVMCI native runtime per thread. ") \
range(0, max_jint) \ range(0, max_jint) \
\ \
product(uint, JVMCICompilerIdleDelay, DEFAULT_COMPILER_IDLE_DELAY, EXPERIMENTAL, \ product(uint, JVMCICompilerIdleDelay, DEFAULT_COMPILER_IDLE_DELAY, EXPERIMENTAL, \
@ -136,11 +137,16 @@ class fileStream;
"and methods the JVMCI shared library must provide") \ "and methods the JVMCI shared library must provide") \
\ \
product(bool, UseJVMCINativeLibrary, false, EXPERIMENTAL, \ product(bool, UseJVMCINativeLibrary, false, EXPERIMENTAL, \
"Execute JVMCI Java code from a shared library " \ "Execute JVMCI Java code from a shared library (\"libjvmci\") " \
"instead of loading it from class files and executing it " \ "instead of loading it from class files and executing it " \
"on the HotSpot heap. Defaults to true if EnableJVMCIProduct is " \ "on the HotSpot heap. Defaults to true if EnableJVMCIProduct is " \
"true and a JVMCI native library is available.") \ "true and a JVMCI native library is available.") \
\ \
product(double, JVMCINativeLibraryThreadFraction, 0.33, EXPERIMENTAL, \
"The fraction of compiler threads used by libjvmci. " \
"The remaining compiler threads are used by C1.") \
range(0.0, 1.0) \
\
product(ccstr, JVMCINativeLibraryErrorFile, NULL, EXPERIMENTAL, \ product(ccstr, JVMCINativeLibraryErrorFile, NULL, EXPERIMENTAL, \
"If an error in the JVMCI native library occurs, save the " \ "If an error in the JVMCI native library occurs, save the " \
"error data to this file" \ "error data to this file" \