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: 44b5b81f76567d0b7fc4687e18c53d7ddbd2e982
  • Loading branch information
RealCLanger committed Nov 23, 2023
1 parent 0f2da83 commit 5531ca5
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 @@ -3860,15 +3860,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

1 comment on commit 5531ca5

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.