8354727: CompilationPolicy creates too many compiler threads when code cache space is scarce #25830
+2
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue Summary
Running
on a machine with more than 255 cores, this would fail with the message that the specified
NonNMethodCodeHeapSize
is 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 to CompilationPolicy::initialize() checking how many compiler buffers fit into theReservedCodeCacheSize
. However, in the case above, this is significantly larger thanNonNMethodCodeHeapSize
and causes a check updated in #17244 to fail that should ensure thatNonNMethodCodeHeapSize
is at leastCodeCacheMinimumUseSpace
plus the size of allCICompilerCount
compiler buffers. This is stronger than before #17244 where this check merely requiredNonNMethodCodeHeapSize >= CodeCacheMinimumUseSpace
due to the fact that compiler buffers can also use the rest of the code cache if the non-nmethod heap is not sufficient.Change Rationale
This PR reverts the failing check to ensuring
NonNMethodCodeHeapSize >= CodeCacheMinimumUseSpace
since the computation of the ergonomicCICompilerCount
inCompilationPolicy::initialize()
does not support the assumption that all compiler buffers must always fit inside the non-nmethod code heap.This change required to adjust a test, because with the weaker check, it is currently not possible to trigger it from the commandline.
Testing
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25830/head:pull/25830
$ git checkout pull/25830
Update a local copy of the PR:
$ git checkout pull/25830
$ git pull https://git.openjdk.org/jdk.git pull/25830/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 25830
View PR using the GUI difftool:
$ git pr show -t 25830
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25830.diff
Using Webrev
Link to Webrev Comment