Skip to content

Commit

Permalink
8313782: Add user-facing warning if THPs are enabled but cannot be used
Browse files Browse the repository at this point in the history
Backport-of: dff99f7f3d98372cb5bf8b1c2515b7628193cd2c
  • Loading branch information
RealCLanger committed Nov 17, 2023
1 parent 99d260c commit 44b5b81
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/hotspot/os/linux/os_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3802,15 +3802,17 @@ void os::large_page_init() {
return;
}

// 2) check if large pages are configured
if ( ( UseTransparentHugePages && HugePages::supports_thp() == false) ||
(!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()) {
if (!FLAG_IS_DEFAULT(UseTransparentHugePages)) {
log_warning(pagesize)("UseTransparentHugePages disabled, transparent huge pages are not supported by the operating system.");
}
UseLargePages = UseTransparentHugePages = UseHugeTLBFS = UseSHM = false;
return;
}
if (!UseTransparentHugePages && !HugePages::supports_static_hugepages()) {
warn_no_large_pages_configured();
UseLargePages = false;
UseTransparentHugePages = false;
UseHugeTLBFS = false;
UseSHM = false;
UseLargePages = UseTransparentHugePages = UseHugeTLBFS = UseSHM = false;
return;
}

Expand Down

3 comments on commit 44b5b81

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

@RealCLanger
Copy link
Contributor Author

Choose a reason for hiding this comment

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

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 44b5b81 Nov 21, 2023

Choose a reason for hiding this comment

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

@RealCLanger the backport was successfully created on the branch RealCLanger-backport-44b5b81f in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 44b5b81f from the openjdk/jdk21u repository.

The commit being backported was authored by Christoph Langer on 17 Nov 2023 and had no reviewers.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev.git RealCLanger-backport-44b5b81f:RealCLanger-backport-44b5b81f
$ git checkout RealCLanger-backport-44b5b81f
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev.git RealCLanger-backport-44b5b81f

Please sign in to comment.