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

Stefan Johansson sjohanss at openjdk.java.net
Tue Feb 22 15:23:51 UTC 2022


On Tue, 22 Feb 2022 13:29:23 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: TestCase issues resolved.

test/hotspot/jtreg/runtime/os/TestExplicitPageAllocation.java line 165:

> 163:                     System.out.println("TestCase Passed for pagesize: " + pageSize + ", allocated pagesize: " + size);
> 164:                     break;
> 165:                 }

The test is still failing for 16G pages: 

TestCase Passed for pagesize: 16G, allocated pagesize: 64K
----------System.err:(12/796)----------
java.lang.AssertionError: TestCase Failed for 16G page allocation, 
	at runtime.os.TestExplicitPageAllocation.testCase(TestExplicitPageAllocation.java:170)
	at runtime.os.TestExplicitPageAllocation.main(TestExplicitPageAllocation.java:69)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:828)


The problem is that `requiredPageCount(i)` will return 0 for 16G pages because the heap is just 1G, so the test will fill in the `errorMessage` and then the test will continue. The test not breking after setting the `errorMessage` also looks a bit wrong. At least it made it a bit harder to spot the error.

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

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


More information about the hotspot-runtime-dev mailing list