-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
JDK-8313782: Add user-facing warning if THPs are enabled but cannot be used #15158
JDK-8313782: Add user-facing warning if THPs are enabled but cannot be used #15158
Conversation
👋 Welcome back stuefe! A progress list of the required criteria for merging this PR into |
UseLargePages = UseTransparentHugePages = UseHugeTLBFS = UseSHM = false; | ||
return; | ||
} | ||
if (!UseTransparentHugePages && HugePages::supports_static_hugepages() == false) { | ||
warn_no_large_pages_configured(); |
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.
Reviewer note: warn_no_large_pages_configured()
is the warning for static hugepage errors, so of no use for THPs.
Webrevs
|
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.
Seem okay. A couple of minor nits/requests.
Thanks
src/hotspot/os/linux/os_linux.cpp
Outdated
(!UseTransparentHugePages && HugePages::supports_static_hugepages() == false) ) { | ||
// No large pages configured, return. | ||
// 2) check if the OS supports THPs resp. static hugepages. | ||
if (UseTransparentHugePages && HugePages::supports_thp() == false) { |
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.
Pre-existing nit: use !HugePages::supports_thp()
rather than == false
.
src/hotspot/os/linux/os_linux.cpp
Outdated
// 2) check if the OS supports THPs resp. static hugepages. | ||
if (UseTransparentHugePages && HugePages::supports_thp() == false) { | ||
if (!FLAG_IS_DEFAULT(UseTransparentHugePages)) { | ||
log_warning(pagesize)("TransparentHugePages is not supported by the operating system."); |
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.
Suggestion:
UseTransparentHugePages disabled, transparent huge pages are not supported by the operating system"
src/hotspot/os/linux/os_linux.cpp
Outdated
UseLargePages = UseTransparentHugePages = UseHugeTLBFS = UseSHM = false; | ||
return; | ||
} | ||
if (!UseTransparentHugePages && HugePages::supports_static_hugepages() == false) { |
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.
Ditto: use ! rather than == false
.
@tstuefe 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:
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 108 new commits pushed to the
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 |
Thanks David; I worked in your feedback. |
Ping. Could I have a second review please? Its rather trivial. |
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.
Thanks @kstefanj and @dholmes-ora ! /integrate |
Going to push as commit dff99f7.
Your commit was automatically rebased without conflicts. |
We don't warn the user if
+UseTransparentHugePages
were specified (and nothing else, but this implies+UseLargePages
), but the system does not support THPs.We used to have warnings in the code, but I checked and they never really worked (I tried older versions of the JDK). The reason is that THP detection had been broken. The broken detection always reported success even if THPs are disabled, so the user would never have seen this warning even when we had it.
THP detection has since been fixed with JDK-8310233, but we still don't warn.
The patch re-introduces the warning, with the same text as it used to have, and using the warning level of UL with the "pagesize" tag - that's what we do for static hugepage warnings too.
Before:
Now:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15158/head:pull/15158
$ git checkout pull/15158
Update a local copy of the PR:
$ git checkout pull/15158
$ git pull https://git.openjdk.org/jdk.git pull/15158/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15158
View PR using the GUI difftool:
$ git pr show -t 15158
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15158.diff
Webrev
Link to Webrev Comment