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

Marcus G K Williams mgkwill at openjdk.java.net
Fri May 14 15:19:44 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>

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

> 3614:   //
> 3615:   // If we can't determine the value (e.g. /proc is not mounted, or the text
> 3616:   // format has been changed), we'll set largest page size to 0

I have a suspicion that this section change is causing the issue @tstuefe is seeing on linux ppc64. I think we are setting `size_t default_large_page_size = 0;` and then attempting an **unfruitful scan of /proc/meminfo**.

Later we get `alignment` using `lcm` in 
https://github.com/openjdk/jdk/blob/16ca370f1ac933a6aef49bd147d985e66b4c8930/src/hotspot/share/gc/shared/gcArguments.cpp#L81

https://github.com/openjdk/jdk/blob/af4cd04c2e393f8d1ffef60f49e3269adee649b8/src/hotspot/share/utilities/globalDefinitions.cpp#L370 


// least common multiple
size_t lcm(size_t a, size_t b) {
    size_t cur, div, next;

    cur = MAX2(a, b);
    div = MIN2(a, b);

    assert(div != 0, "lcm requires positive arguments");



But `os::large_page_size()` returns 0 instead of a default for the processor as before due to the new version of `scan_default_large_page_size()`.

This is my hunch from looking at the code. Still investigating and I will try setting a 64k page size in `os::vm_page_size()`.

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

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



More information about the hotspot-gc-dev mailing list