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

Stefan Johansson sjohanss at openjdk.java.net
Tue Feb 23 17:48:54 UTC 2021


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).

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

Commit messages:
 - 8261636: The test mapping in hugetlbfs_sanity_check should consider LargePageSizeInBytes

Changes: https://git.openjdk.java.net/jdk/pull/2695/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2695&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8261636
  Stats: 7 lines in 1 file changed: 4 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2695.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2695/head:pull/2695

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


More information about the hotspot-runtime-dev mailing list