8343153: compiler/codecache/CheckLargePages.java fails on linux with huge pages configured but its number set to 0 #21757
+9
−3
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
The third test of
compiler/codecache/CheckLargePages.java
checks that non-segmented 1GB code cache can be allocated with 1GB large pages.On linux (the only supported platform) in order to allocate them, 1GB huge pages have to be enabled (checkable from
/proc/meminfo
and/sys/kernel/mm/hugepages/hugepages-xxxx
) and their number has to be set to >0 (checkable from/sys/kernel/mm/hugepages/hugepages-xxxx/nr_hugepages
).If 1GB huge pages are enabled but their number is 0, the test fails because it looks for a string that matches
CodeCache: min=1[gG] max=1[gG] base=[^ ]+ size=1[gG] page_size=1[gG]
but the actual output isCodeCache: min=1G max=1G base=0x00007f4040000000 size=1G page_size=2M
. This happens because the VM tries to allocate 1GB huge pages but it fails beause the number of allocatable ones is 0 and the VM reverts to smaller page sizes (2MB in this case).Solution
The problem might be attributed to the VM only checking for 1GB huge pages to be supported, not how many there currently are. Nevertheless, this seems to be the correct behaviour, not least because their number can be changed dynamically.
So, the correct thing to do seems to be to "relax" the check made by the test to include both cases:
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/21757/head:pull/21757
$ git checkout pull/21757
Update a local copy of the PR:
$ git checkout pull/21757
$ git pull https://git.openjdk.org/jdk.git pull/21757/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 21757
View PR using the GUI difftool:
$ git pr show -t 21757
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/21757.diff