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
Reviewed-by: dholmes, sjohanss
  • Loading branch information
tstuefe committed Aug 15, 2023
1 parent f4e72c5 commit dff99f7
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 @@ -3793,15 +3793,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 dff99f7

@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

Choose a reason for hiding this comment

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

/backport jdk21u

@openjdk
Copy link

@openjdk openjdk bot commented on dff99f7 Nov 13, 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-dff99f7f in my personal fork of openjdk/jdk21u. To create a pull request with this backport targeting openjdk/jdk21u: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 dff99f7f from the openjdk/jdk repository.

The commit being backported was authored by Thomas Stuefe on 15 Aug 2023 and was reviewed by David Holmes and Stefan Johansson.

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/jdk21u:

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

Please sign in to comment.