RFR: 8271195: Use largest available large page size smaller than LargePageSizeInBytes when available
Albert Mingkun Yang
ayang at openjdk.java.net
Thu Feb 3 16:56:13 UTC 2022
On Wed, 2 Feb 2022 15:58:53 GMT, Swati Sharma <duke at openjdk.java.net> wrote:
> Hi Team,
>
> In this patch I have fixed two issues related to large pages, following is the summary of changes :-
>
> 1. Patch fixes existing large page allocation functionality where if a commit over 1GB pages fails allocation should happen over next small page size i.e. 2M where as currently its happening over 4kb pages resulting into significant TLB miss penalty.
> Patch includes new JTREG Test case covering various scenarios for checking the correct explicit page allocation according to the 1G, 2M, 4K priority.
> 2. While attempting commit over larger pages we first try to reserve requested bytes over the virtual address space, in case commit to large page fails we should be un reserving entire reservation to avoid leaving any leaks in virtual address space.
>
>
> Please find below the performance data with and without patch for the JMH benchmark included with the patch.
>
> 
>
>
> Please review and provide your valuable comments.
>
>
>
> Thanks,
> Swati Sharma
> Runtime Software Development Engineer
> Intel
Changes requested by ayang (Reviewer).
src/hotspot/os/linux/os_linux.cpp line 3782:
> 3780: os::Linux::setup_large_page(page_size)) {
> 3781: _large_page_size = page_size;
> 3782: large_page_found = true;
I don't think this is at the right level: here we don't yet know which kind of large page to use, which is decided in `os::Linux::setup_large_page_type` (the original name).
Instead, the fix should be inside `hugetlbfs_sanity_check`, sth like:
for (local_page_size = page_size; page_size_ != (size_t)os::vm_page_size(); local_page_size = _page_sizes.next_smaller(local_page_size) {
if (try_commit_using_large_page(local_page_size)) {
_large_page_size = local_page_size;
return true;
}
}
return false;
src/hotspot/os/linux/os_linux.cpp line 4038:
> 4036: if (!large_committed) {
> 4037: // Failed to commit large pages, so we need to unmap the whole reservation.
> 4038: ::munmap(aligned_start, bytes);
I don't understand why this change is related to this ticket/PR, or needed at all.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7326
More information about the hotspot-gc-dev
mailing list