RFR: 8261636: The test mapping in hugetlbfs_sanity_check should consider LargePageSizeInBytes [v2]

Thomas Schatzl tschatzl at openjdk.java.net
Mon Mar 1 10:22:03 UTC 2021


On Mon, 1 Mar 2021 10:19:10 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).
>
> Stefan Johansson has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8261636: Thomas review
>   
>   Added helper for adding the large page size flag when needed.

A cpp file local static method would have been fine with me too, but this is as good.

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

Marked as reviewed by tschatzl (Reviewer).

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


More information about the hotspot-runtime-dev mailing list