Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8293019: [JVMCI] change ratio of libgraal to C1 threads and use one i…
…solate per libgraal thread

Reviewed-by: never, iveresov
  • Loading branch information
Doug Simon committed Aug 31, 2022
1 parent 0d51f63 commit 3c1bda4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
14 changes: 12 additions & 2 deletions src/hotspot/share/compiler/compilationPolicy.cpp
Expand Up @@ -485,8 +485,18 @@ void CompilationPolicy::initialize() {
} else if (c2_only) {
set_c2_count(count);
} else {
set_c1_count(MAX2(count / 3, 1));
set_c2_count(MAX2(count - c1_count(), 1));
#if INCLUDE_JVMCI
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");
set_increase_threshold_at_ratio();
Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/jvmci/jvmci_globals.cpp
Expand Up @@ -122,6 +122,7 @@ bool JVMCIGlobals::check_jvmci_flags_are_consistent() {
CHECK_NOT_SET(JVMCIThreadsPerNativeLibraryRuntime, EnableJVMCI)
CHECK_NOT_SET(JVMCICompilerIdleDelay, EnableJVMCI)
CHECK_NOT_SET(UseJVMCINativeLibrary, EnableJVMCI)
CHECK_NOT_SET(JVMCINativeLibraryThreadFraction, EnableJVMCI)
CHECK_NOT_SET(JVMCILibPath, EnableJVMCI)
CHECK_NOT_SET(JVMCINativeLibraryErrorFile, EnableJVMCI)
CHECK_NOT_SET(JVMCILibDumpJNIConfig, EnableJVMCI)
Expand Down Expand Up @@ -181,6 +182,7 @@ bool JVMCIGlobals::enable_jvmci_product_mode(JVMFlagOrigin origin) {
"JVMCILibPath",
"JVMCILibDumpJNIConfig",
"UseJVMCINativeLibrary",
"JVMCINativeLibraryThreadFraction",
"JVMCINativeLibraryErrorFile",
NULL
};
Expand Down
12 changes: 9 additions & 3 deletions src/hotspot/share/jvmci/jvmci_globals.hpp
Expand Up @@ -58,9 +58,10 @@ class fileStream;
"Use JVMCI as the default compiler. Defaults to true if " \
"EnableJVMCIProduct is true.") \
\
product(uint, JVMCIThreadsPerNativeLibraryRuntime, 0, EXPERIMENTAL, \
product(uint, JVMCIThreadsPerNativeLibraryRuntime, 1, EXPERIMENTAL, \
"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) \
\
product(uint, JVMCICompilerIdleDelay, DEFAULT_COMPILER_IDLE_DELAY, EXPERIMENTAL, \
Expand Down Expand Up @@ -136,11 +137,16 @@ class fileStream;
"and methods the JVMCI shared library must provide") \
\
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 " \
"on the HotSpot heap. Defaults to true if EnableJVMCIProduct is " \
"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, \
"If an error in the JVMCI native library occurs, save the " \
"error data to this file" \
Expand Down

1 comment on commit 3c1bda4

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.