RFR: 8273872: ZGC: Explicitly use 2M large pages
Stefan Johansson
sjohanss at openjdk.java.net
Thu Sep 16 08:34:51 UTC 2021
On Thu, 16 Sep 2021 07:59:32 GMT, Per Liden <pliden at openjdk.org> wrote:
> ZGC requires large pages to be 2M. However, ZGC doesn't explicitly asks for this page size and instead relies on the default large pages size for the system to be 2M. On systems where this is not true, ZGC will fails with an error message. To avoid this, ZGC should explicitly ask for 2M large pages and not rely on the system default. Furthermore, ZGC currently ignores `-XX:LargePageSizeInBytes`. ZGC should fails with an error message if it's specified to something other than 2M.
src/hotspot/share/gc/z/zArguments.cpp line 78:
> 76: if (!FLAG_IS_DEFAULT(LargePageSizeInBytes) && LargePageSizeInBytes != 2 * M) {
> 77: vm_exit_during_initialization("Invalid -XX:LargePageSizeInBytes (only 2M large pages is supported)");
> 78: }
To better handle the case where the default large page size is not supported I suggest we add something like:
if (LargePageSizeInBytes != 2 * M) {
if (FLAG_IS_DEFAULT(LargePageSizeInBytes)) {
vm_exit_during_initialization("Default large page size is not supported (only 2M large pages are supported)");
} else {
vm_exit_during_initialization("Invalid -XX:LargePageSizeInBytes (only 2M large pages are supported)");
}
}
Probably good to include the default size in the above print.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5541
More information about the hotspot-dev
mailing list