RFR: 8271195: Use largest available large page size smaller than LargePageSizeInBytes when available [v3]

Albert Mingkun Yang ayang at openjdk.java.net
Fri Feb 4 13:33:11 UTC 2022


On Fri, 4 Feb 2022 12:50:49 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.
>> 
>> ![image](https://user-images.githubusercontent.com/96874289/152189587-4822a4ca-f5e2-4621-b405-0da941485143.png)
>> 
>> 
>> Please review and provide your valuable comments.
>> 
>> 
>> 
>> Thanks,
>> Swati Sharma
>> Runtime Software Development Engineer 
>> Intel
>
> Swati Sharma has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8271195: Review comments resolved.

Two small and subjective suggestions:

1. `try_commit_using_large_page` can be dropped from the header (API), (i.e. change to a file-local function, `static bool try_commit_using_large_page(...) {...}`.
2. Placing `log_info` inside `hugetlbfs_sanity_check` feels cleaner (the assignment is next to the msg), sth like:


if (try_commit_using_large_page...) {
  _large_page_size = ...
  log_info(... success ...);
  return true;
}
log_info(... fail ...);


I don't see much benefit of adding `MicroLargePages.java`. Would be nice if someone more experience on this can share their opinions.

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

Marked as reviewed by ayang (Reviewer).

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


More information about the hotspot-runtime-dev mailing list