RFR: JDK-8256155: os::Linux Populate all large_page_sizes, select smallest page size in reserve_memory_special_huge_tlbfs* [v5]
Thomas Stuefe
stuefe at openjdk.java.net
Mon Dec 7 10:40:13 UTC 2020
On Fri, 4 Dec 2020 00:07:12 GMT, Marcus G K Williams <github.com+168222+mgkwill at openjdk.org> wrote:
>> When using LargePageSizeInBytes=1G, os::Linux::reserve_memory_special_huge_tlbfs* cannot select large pages smaller than 1G. Code heap usually uses less than 1G, so currently the code precludes code heap from using
>> Large pages in this circumstance and when os::Linux::reserve_memory_special_huge_tlbfs* is called page sizes fall back to Linux::page_size() (usually 4k).
>>
>> This change allows the above use case by populating all large_page_sizes present in /sys/kernel/mm/hugepages in _page_sizes upon calling os::Linux::setup_large_page_size().
>>
>> In os::Linux::reserve_memory_special_huge_tlbfs* we then select the largest large page size available in _page_sizes that is smaller than bytes being reserved.
>
> Marcus G K Williams has updated the pull request incrementally with one additional commit since the last revision:
>
> Remove remnant UseSHM change
>
> Signed-off-by: Marcus G K Williams <marcus.williams at intel.com>
Hi Marcus,
I generally like this patch. I will do a more thorough review later. But could this wait please until after JDK16 has been forked off? Since I would like this to spend some more times cooking on our more exotic Linuxes.
Cheers, Thomas
src/hotspot/os/linux/os_linux.cpp line 3743:
> 3741: // The kernel is using kB, hotspot uses bytes
> 3742: if (page_size * K > (size_t)Linux::page_size()) {
> 3743: if (!os::page_sizes().is_set(page_size * K)) {
is_set is not needed, just call add
-------------
PR: https://git.openjdk.java.net/jdk/pull/1153
More information about the hotspot-dev
mailing list