RFR: 8256155: Allow multiple large page sizes to be used on Linux [v36]

Stefan Johansson sjohanss at openjdk.java.net
Mon May 17 07:37:20 UTC 2021


On Wed, 12 May 2021 22:47:15 GMT, Marcus G K Williams <mgkwill at openjdk.org> wrote:

>> Change the meaning of LargePageSizeInBytes to be the maximum large page size the JVM may use (not the only one). A default value of zero will mean to allow the JVM use large page sizes up to the system's default large page size.
>
> Marcus G K Williams has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Reuse flags & p vars, fix enclose
>   
>   Signed-off-by: Marcus G K Williams <marcus.williams at intel.com>

Some additional comments. The update to `globals.hpp`stated in the CSR should also be included in this change:

diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp
index cfe5fd8116c..2d09075fb48 100644
--- a/src/hotspot/share/runtime/globals.hpp
+++ b/src/hotspot/share/runtime/globals.hpp
@@ -239,7 +239,8 @@ const intx ObjectAlignmentInBytes = 8;
           "Use intrinsics for java.util.Base64")                            \
                                                                             \
   product(size_t, LargePageSizeInBytes, 0,                                  \
-          "Large page size (0 to let VM choose the page size)")             \
+          "Maximum large page size used (0 will use the default large "     \
+          "page size for the environment as the maximum)")                  \
           range(0, max_uintx)                                               \
                                                                             \
   product(size_t, LargePageHeapSizeThreshold, 128*M,                        \

src/hotspot/os/linux/os_linux.cpp line 3512:

> 3510:   } else {
> 3511:       log_info(pagesize)("Large page size (" SIZE_FORMAT "%s) failed sanity check "
> 3512:                          "checking if smaller large page sizes are usable",

Please add a comma. 
Suggestion:

      log_info(pagesize)("Large page size (" SIZE_FORMAT "%s) failed sanity check, "
                         "checking if smaller large page sizes are usable",

src/hotspot/os/linux/os_linux.cpp line 3798:

> 3796:     _page_sizes.print_on(&ls);
> 3797:     ls.print("All large Page sizes: ");
> 3798:     all_large_pages.print_on(&ls);

I would prefer having those on separate lines and I also think the "all" part should be moved to the scanning function and be on `debug` level. The complete output would then be something like:

[0.001s][debug][pagesize] Large page sizes: 2M, 1G
[0.001s][info ][pagesize] Using the default large page size: 2M
[0.001s][info ][pagesize] Usable page sizes: 4k, 2M

-------------

Changes requested by sjohanss (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/1153



More information about the hotspot-gc-dev mailing list