RFR: 8261636: The test mapping in hugetlbfs_sanity_check should consider LargePageSizeInBytes

Thomas Schatzl tschatzl at openjdk.java.net
Mon Mar 1 09:17:40 UTC 2021


On Tue, 23 Feb 2021 17:29:44 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

> When explicit large pages are enabled we do a sanity check to test if there are large pages configured. This sanity check just tests if there are any pages available of the systems default large page size. When the flag `LargePageSizeInBytes` is specified the JVM will try to use this large page size for all its mapping, except for the first sanity mapping. This can lead to large pages being disabled because the sanity mapping failed, while there are still plenty of pages available of the size specified by `LargePageSizeInBytes`.
> 
> The fix is to simply take the large page size into consideration in the sanity-check, making sure the correct flags are passed when needed.
> 
> **Testing**
> * Manual testing verifying the problem when for example only 1g pages are available. Before the fix these large pages could not be used (unless the default large page size was changed to 1g or there were also 2m pages configured).

Since the exact same code to add these bits is now three times in that file, it may be interesting to add and use a (static?) method?

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

Changes requested by tschatzl (Reviewer).

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


More information about the hotspot-runtime-dev mailing list