-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8344727: [JVMCI] Export the CompileBroker compilation activity mode for Truffle compiler control #22295
base: master
Are you sure you want to change the base?
8344727: [JVMCI] Export the CompileBroker compilation activity mode for Truffle compiler control #22295
Conversation
…or Truffle compiler control
👋 Welcome back simonis! A progress list of the required criteria for merging this PR into |
@simonis This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 53 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Truffle compilations run in "hosted" mode, i.e. the Truffle runtimes triggers compilations independently of HotSpot's
CompileBroker
. But the results of Truffle compilations are still stored as ordinary nmethods in HotSpot's code cache (with the help of the JVMCI methodjdk.vm.ci.hotspot.HotSpotCodeCacheProvider::installCode()
). The regular JIT compilers are controlled by theCompileBroker
which is aware of the code cache occupancy. If the code cache runs full, theCompileBroker
temporary pauses any subsequent JIT compilations until the code cache gets swept (if running with-XX:+UseCodeCacheFlushing -XX:+MethodFlushing
which is the default) or completely shuts down the JIT compilers if running with-XX:+UseCodeCacheFlushing
.Truffle compiled methods can contribute significantly to the overall code cache occupancy and they can trigger JIT compilation stalls if they fill the code cache up. But the Truffle framework itself is neither aware of the current code cache occupancy, nor of the compilation activity of the
CompileBroker
. If Truffle tries to install a compiled method through JVMCI and the code cache is full, it will silently fail. Currently Truffle interprets such failures as transient errors and basically ignores it. Whenever the corresponding method gets hot again (usually immediately at the next invocation), Truffle will recompile it again just to fail again in the nmethod installation step, if the code cache is still full.When the code cache is tight, this can lead to situations, where Truffle is unnecessarily and repeatedly compiling methods which can't be installed in the code cache but produce a significant CPU load. Instead, Truffle should poll HotSpot's
CompileBroker
compilation activity and pause compilations for the time theCompileBroker
is pausing JIT compilations (or completely shutdown Truffle compilations if theCompileBroker
shut down the JIT compilers). In order to make this possible, JVMCI should export the CompileBroker compilation activity mode (i.e.stop_compilation
,run_compilation
orshutdown_compilation
).The corresponding Truffle change is tracked under #10133: Implement Truffle compiler control based on HotSpot's CompileBroker compilation activity.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22295/head:pull/22295
$ git checkout pull/22295
Update a local copy of the PR:
$ git checkout pull/22295
$ git pull https://git.openjdk.org/jdk.git pull/22295/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22295
View PR using the GUI difftool:
$ git pr show -t 22295
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22295.diff
Using Webrev
Link to Webrev Comment