-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8354727: CompilationPolicy creates too many compiler threads when code cache space is scarce #25770
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
Conversation
|
/contributor add @shipilev |
|
👋 Welcome back mhaessig! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
@mhaessig |
dafedafe
left a comment
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.
Thanks for fixing this @mhaessig.
I guess the issue cannot happen if NonNMethodCodeHeapSize is not given as a flag as it will be dynamically adapted to the number of compiler threads created, right?
|
Thank you for having a look @dafedafe!
That is right. In this case, the heuristics in |
dafedafe
left a comment
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 to me. Thanks @mhaessig.
|
@mhaessig this pull request can not be integrated into git checkout JDK-8354727-policy
git fetch https://git.openjdk.org/jdk.git pr/25791
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge pr/25791"
git push |
Co-authored-by: Aleksey Shipilev <shade@openjdk.org>
Co-developed-by: Damon Fenacci <dfenacci@openjdk.org>
b62ef8a to
98a8107
Compare
|
@mhaessig Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
|
I made this dependent on #25791 and rebased onto it. |
Issue Summary
Running
java -XX:+SegmentedCodeCache -XX:ReservedCodeCacheSize=10M -XX:NonNMethodCodeHeapSize=6M \ -XX:ProfiledCodeHeapSize=5M -XX:NonProfiledCodeHeapSize=5M -versionon a machine with more than 255 cores, this would fail with the message that the specified
NonNMethodCodeHeapSizeis too small to fit all compiler buffers (instead of failing because the sum of the heaps is larger than theReservedCodeCacheSize). Hence, the calculated compiler count is too high. This is due toCompilationPolicy::initialize()checking how many compiler buffers fit into theReservedCodeCacheSize. However, in the case above, this is significantly larger thanNonNMethodCodeHeapSizeand causes a new check introduced in #17244 to fail.Changes
This PR fixes the calculation of the
CICompilerCountergonomic. Firstly, @shipilev kindly provided a fix for the compiler buffer size used in the calculation is also correct if we only have C2. Secondly,NonNMethodHeapSizeis used as the maximum buffers size available for compilers buffers instead ofReservedCodeCacheSizeif it was provided as a commandline flag.It might be debatable if this is the correct fix, since the
NonNMethodHeapcan spill into the other heaps if it is too small. However, I am of the opinion that if theNonNMethodHeapSizeis explicitly specified, then the compiler count should be calculated accordingly.Testing
Progress
Integration blocker
Issue
Reviewers
Contributors
<shade@openjdk.org>Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25770/head:pull/25770$ git checkout pull/25770Update a local copy of the PR:
$ git checkout pull/25770$ git pull https://git.openjdk.org/jdk.git pull/25770/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 25770View PR using the GUI difftool:
$ git pr show -t 25770Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25770.diff
Using Webrev
Link to Webrev Comment