RFR(s): 8023905: Failing to initialize VM with small initial heap when NUMA and large pages are enabled

Stefan Johansson stefan.johansson at oracle.com
Wed Aug 24 13:29:39 UTC 2016


Hi Sangheon,

Thanks for looking at this issue.

On 2016-08-10 19:28, sangheon wrote:
> Hi all,
>
> Can I have some reviews for this change?
>
> NUMA and large pages are not compatible in Linux as large pages cannot 
> uncommit pages(os_linux.cpp:line 4828 [1]). So we use pin region for 
> this case. If we succeed to reserve with large pages for small initial 
> heap, we will fail when free memory for biasing. The reason is that 
> when we initialize NUMA with large pages, we change the page size to 
> the default page size if the allocated pages are small.
>
> I am proposing to exit the VM at that time. Adding an exception seems 
> not good idea for this small heap which seems not practical for NUMA + 
> large page case.
> The added test is checking the exit message if both NUMA and large 
> pages are supported.
>
> CR: https://bugs.openjdk.java.net/browse/JDK-8023905
> Webrev: http://cr.openjdk.java.net/~sangheki/8023905/webrev.0
A few comments.

I agree that having the VM exit is good, but I think the exit message 
should include info that large pages caused this. Something like: 
"Failed initializing NUMA with large pages. Too small heap size"

Another thing is the use of #ifdef to make this conditional for Linux. 
Is this needed? Isn't the return value for 
can_commit_large_page_memory() the conditional we should care about? Or 
will we fail some platform too early. If so, we could add another 
capability method to the os class and use that to avoid having the 
#ifdef in the code.

Regarding the comment, I'm not sure what you mean by "pin region". I 
might be missing something but I think the comment need more information 
to be easier to understand.

Thanks,
Stefan

> Testing: JPRT, manual test on NUMA + large page supported machine.
>
> Thanks,
> Sangheon
>
> [1]:
> // With SHM and HugeTLBFS large pages we cannot uncommit a page, so 
> there's no way
> // we can make the adaptive lgrp chunk resizing work. If the user 
> specified
> // both UseNUMA and UseLargePages (or UseSHM/UseHugeTLBFS) on the 
> command line - warn and
> // disable adaptive resizing.




More information about the hotspot-gc-dev mailing list