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

Stefan Johansson sjohanss at openjdk.java.net
Mon Apr 26 08:53:45 UTC 2021


On Fri, 23 Apr 2021 22:24:38 GMT, Marcus G K Williams <github.com+168222+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 with a new target base due to a merge or a rebase. The pull request now contains 48 commits:
> 
>  - Set LargePageSizeInBytes to largepage upper limit
>    
>    Signed-off-by: Marcus G K Williams <marcus.williams at intel.com>
>  - Merge branch 'master' into update_hlp
>  - Fix merge
>    
>    Signed-off-by: Marcus G K Williams <marcus.williams at intel.com>
>  - Merge branch 'master' into update_hlp
>  - Merge branch 'master' into update_hlp
>  - Rebase on pull/3073
>    
>    Signed-off-by: Marcus G K Williams <marcus.williams at intel.com>
>  - Merge branch 'pull/3073' into update_hlp
>  - Thomas review.
>    
>    Changed commit_memory_special to return bool to signal if the request succeeded or not.
>  - Self review.
>    
>    Update helper name to better match commit_memory_special().
>  - Marcus review.
>    
>    Updated comments.
>  - ... and 38 more: https://git.openjdk.java.net/jdk/compare/5aab1609...6f063309

Changes requested by sjohanss (Reviewer).

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

> 3735:   // Populate large page sizes to _page_sizes. Add pages that
> 3736:   // are less than or equal to LargePageSizeInBytes, except when LargePageSizeInBytes=0
> 3737:   // or FLAG_IS_DEFAULT(LargePageSizeInBytes), add all sizes

What we currently have in the CSR is to use the default large page size as the max if `LargePageSizeInBytes`is not set. If we first check if `LargePageSizeInBytes` have been set and update `_large_page_size` accordingly above (see comment below). I think this comment should say something like:

Suggestion:

  // Populate _page_sizes with large page sizes less than or equal to
  // _large_page_size.

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

> 3765:   } else {
> 3766:     _large_page_size = default_large_page_size;
> 3767:   }

Move this part up to be done before you populate `_page_sizes` with the page sizes from `all_page_sizes`. Then you can use `_large_page_size` as the maximum page size that you add to `_page_sizes` and you don't have to care about `LargePageSizeInBytes` in that for-loop.

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

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



More information about the hotspot-gc-dev mailing list