Skip to content

8364114: Test TestHugePageDecisionsAtVMStartup.java#LP_enabled fails when no free hugepage#26480

Closed
sendaoYan wants to merge 3 commits intoopenjdk:masterfrom
sendaoYan:jbs8364114
Closed

8364114: Test TestHugePageDecisionsAtVMStartup.java#LP_enabled fails when no free hugepage#26480
sendaoYan wants to merge 3 commits intoopenjdk:masterfrom
sendaoYan:jbs8364114

Conversation

@sendaoYan
Copy link
Member

@sendaoYan sendaoYan commented Jul 25, 2025

Hi all,

The test runtime/os/TestHugePageDecisionsAtVMStartup.java#LP_enabled will fails when there is no free hugepases.
The /proc/meminfo and /sys/kernel/mm/hugepages/hugepages-*/free_hugepages says there is no free hugepage, and the JVM output also say there is available large page.

> cat /proc/meminfo | grep -i HugePages
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
FileHugePages:         0 kB
HugePages_Total:       2
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        2
Hugepagesize:       2048 kB

> ( set -x ; cat /sys/kernel/mm/hugepages/hugepages-*/free_hugepages )
+ cat /sys/kernel/mm/hugepages/hugepages-1048576kB/free_hugepages /sys/kernel/mm/hugepages/hugepages-2048kB/free_hugepages
0
0

JVM output snippet from java -XX:+UseLargePages -Xlog:pagesize -version
[0.001s][info][pagesize] Large page size (2M) failed sanity check, checking if smaller large page sizes are usable
[0.001s][warning][pagesize] UseLargePages disabled, no large pages configured and available on the system.

The JVM can not use large page when there is no available large page on system, it's not a JVM bug. So I think it's not suitable to report test failure, but report SkippedException.

Change has been verified locally, test report SkippedException on the system without free hugepage, the test passes on the system with free hugepage. Test-fix only, risk is low.


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-8364114: Test TestHugePageDecisionsAtVMStartup.java#LP_enabled fails when no free hugepage (Enhancement - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26480/head:pull/26480
$ git checkout pull/26480

Update a local copy of the PR:
$ git checkout pull/26480
$ git pull https://git.openjdk.org/jdk.git pull/26480/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 26480

View PR using the GUI difftool:
$ git pr show -t 26480

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26480.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 25, 2025

👋 Welcome back syan! 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 Jul 25, 2025

@sendaoYan 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:

8364114: Test TestHugePageDecisionsAtVMStartup.java#LP_enabled fails when no free hugepage

Reviewed-by: stuefe, dholmes

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 20 new commits pushed to the master branch:

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 25, 2025
@openjdk
Copy link

openjdk bot commented Jul 25, 2025

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

  • hotspot-runtime

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.

@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Jul 25, 2025
@mlbridge
Copy link

mlbridge bot commented Jul 25, 2025

Webrevs

Copy link
Member

@tstuefe tstuefe left a 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.

Side note, I was long on the fence about just throwing that JVM-side startup test out. Since it seems superfluous - without the test, we would just proceed allocating the heap, not get the desired large pages, which would produce almost the same result. And it is no guarantee anyway, since we may pass the test and later fail to allocate the much larger heap.

Copy link
Member

@tstuefe tstuefe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jul 26, 2025
@sendaoYan
Copy link
Member Author

Thanks for the reviews and suggestions @tstuefe

Do we need the second reviewer to this PR

@dholmes-ora
Copy link
Member

Do we need the second reviewer to this PR

Yes. If it touches src/hotspot or test/hotspot, and is not a trivial fix (per the developer guide[1]) then we require two reviews.

[1] https://openjdk.org/guide/#trivial-changes

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't quite see how the first version of the change was actually reading the value from /proc/meminfo, but I don't like that we parse /proc/meminfo twice now - that's unnecessarily inefficient IMO. That said, it isn't a lot of information so I won't insist on a change.

Approved.

@sendaoYan
Copy link
Member Author

Thanks @tstuefe @dholmes-ora for the reviews and suggetions.

/integrate

@openjdk
Copy link

openjdk bot commented Jul 28, 2025

Going to push as commit 3b0da29.
Since your change was applied there have been 20 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jul 28, 2025
@openjdk openjdk bot closed this Jul 28, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jul 28, 2025
@openjdk
Copy link

openjdk bot commented Jul 28, 2025

@sendaoYan Pushed as commit 3b0da29.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@sendaoYan sendaoYan deleted the jbs8364114 branch August 20, 2025 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants