RFR: 8244752: Enable Linux support for multiple huge page sizes -XX:LargePageSizeInBytes
thomas.schatzl at oracle.com
Tue May 12 08:50:34 UTC 2020
On 11.05.20 18:46, Ivan Walulya wrote:
> Hi all,
> Please review this enhancement to enable selecting a desired huge page size on Linux systems that support multiple huge page sizes.
> JBS: https://bugs.openjdk.java.net/browse/JDK-8244752
> Webrev: http://cr.openjdk.java.net/~iwalulya/8244752/00/
> Testing: Tier 1 - 3
CI does not have large page enabled machines at the moment. What local
testing did you perform?
- in the comment with the MAP_HUGE* flags, please add the information
that you got this from the mmap(2) man page, and that this is since
Linux 3.8. (I understand it's "obvious", but just to make it clear)
- what happens when run on < Linux 3.8 and the flags are used? (not sure
Hotspot minimal requirements _are_ Linux 3.8+, at least for hugetlbfs
- os_linux.cpp:3846: "if(entry->d_type == DT_DIR" missing space after
the "if". At the end of the condition there is an unusual extra space.
- in os::Linux::reserve_memory_special_huge_tlbfs_only, are you sure
that on non-x64 (e.g. arm64) the only supported page sizes for hugetlbfs
are 2M and 1GB?
From what I understand, on e.g. arm64 this is only the case with 4k
"small" page size. I do not know if that is different with e.g. 64k
pages (as in: if you have 16k/64k pages, then the hugetlbfs page sizes
Looking at https://wiki.debian.org/Hugepages, in the arm64 "Multiple
huge page size support" section, it mentions:
"If one elects to build their own Debian arm64 kernel with
CONFIG_ARM64_64K_PAGES=y, then only 512MB HugeTLB (and THP) pages are
available. These are available at run time. "
So I recommend calculating the flag value based on the
LargePageSizeInBytes value, not strictly using the constants (which then
can be removed). Still there is some concern that on Linux < 3.8 this
won't work (or fail).
More information about the hotspot-gc-dev