Skip to content
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

8343153: compiler/codecache/CheckLargePages.java fails on linux with huge pages configured but its number set to 0 #21757

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dafedafe
Copy link
Contributor

@dafedafe dafedafe commented Oct 29, 2024

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 is CodeCache: 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:

  • when 1GB huge pages are supported and can be allocated correctly
  • when 1GB huge pages are supported and cannot be allocated correctly (because there are none available)

Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8343153: compiler/codecache/CheckLargePages.java fails on linux with huge pages configured but its number set to 0 (Bug - P4)

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

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 29, 2024

👋 Welcome back dfenacci! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Oct 29, 2024

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title JDK-8343153: compiler/codecache/CheckLargePages.java fails on linux with huge pages configured but its number set to 0 8343153: compiler/codecache/CheckLargePages.java fails on linux with huge pages configured but its number set to 0 Oct 29, 2024
@openjdk
Copy link

openjdk bot commented Oct 29, 2024

@dafedafe The following label will be automatically applied to this pull request:

  • hotspot-compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

1 participant