RFR: 8245000: Windows GDI functions don't support large pages
Kim Barrett
kim.barrett at oracle.com
Mon May 18 11:56:17 UTC 2020
> On May 18, 2020, at 4:17 AM, Stefan Karlsson <stefan.karlsson at oracle.com> wrote:
>
> On 2020-05-15 20:26, Kim Barrett wrote:
>>> On May 15, 2020, at 1:47 PM, Stefan Karlsson <stefan.karlsson at oracle.com> wrote:
>>>
>>> Hi all,
>>>
>>> Please review this patch to turn off -XX:+UseLargePages as long as Windows GDI functions don't work with large pages.
>>>
>>> https://cr.openjdk.java.net/~stefank/8245000/webrev.00.cleanup
>>> https://cr.openjdk.java.net/~stefank/8245000/webrev.01.workaround
>>> https://cr.openjdk.java.net/~stefank/8245000/webrev.all/
>> A couple of things that may or may not need to be addressed.
>> Otherwise, looks good to me.
>>
>> ------------------------------------------------------------------------------
>> src/hotspot/os/windows/os_windows.cpp
>> 3118 if (_large_page_size > default_page_size) {
>> ...
>> 3124 UseLargePages = _large_page_size != 0;
>>
>> Should UseLargePages be true if _large_page_size > 0 but < default_page_size?
>> (Assuming that's actually possible, but I see nothing in this code
>> that makes that impossible. The OS might...)
>>
>> The old code did the same thing, so if it's a bug, it's been there all along.
>
> The code that sets up _lage_page_size uses GetLargePageMinimum, which sets the size to the system's large page size or 0. It's not explicitly stated that it's not < default_page_size (4 * 1024), but it would really surprise me if it was:
>
> https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-getlargepageminimum
>
> It also uses LargePageSizeInBytes, but only if it is larger than, and aligned to, the given GetLargePageMinimum value.
>
> So, I think we are OK here.
Thanks for the explanation and the doc pointer. Agreed this is okay.
>> src/hotspot/os/windows/os_windows.cpp
>> 2920 if (!gdi_can_use_split_reservation_memory(UseLargePages, min_interleave_granularity)) {
>> 2921 WARN("Windows GDI cannot handle split reservations.");
>> 2922 WARN("...Ignoring UseNUMAInterleaving flag.");
>>
>> If the failure is due to UseLargePages, it might be worth mentioning
>> that in the warning.
>
> We've already done the large pages checks when this code runs. If we can't use large pages, the UseLargePages flag will have been turned off at this point.
Oh, of course.
Looks good.
More information about the hotspot-dev
mailing list