Currently the sanity check performed for hugetlbfs large pages tries a mapping using the default large page size. If the flag LargePageSizeInBytes is set it would make sense to perform the sanity check taking this into consideration.
For example, if a Linux system is configured with 1g pages but no 2m pages (but this is still the default page size), the sanity check will fail leaving the system not trying to use hugetlbfs pages at all.
The updated sanity check should do something like this before performing the mapping to add the needed flag:
if (os::large_page_size() != default_large_page_size()) {
flags |= (exact_log2(os::large_page_size()) << MAP_HUGE_SHIFT);
}
For example, if a Linux system is configured with 1g pages but no 2m pages (but this is still the default page size), the sanity check will fail leaving the system not trying to use hugetlbfs pages at all.
The updated sanity check should do something like this before performing the mapping to add the needed flag:
if (os::large_page_size() != default_large_page_size()) {
flags |= (exact_log2(os::large_page_size()) << MAP_HUGE_SHIFT);
}
- relates to
-
JDK-8262235 Remove unnecessary logic in hugetlbfs_sanity_check()
-
- Resolved
-