RFR: 8338136: Hotspot should support multiple large page sizes on Windows [v2]
Dhamoder Nalla
dhanalla at openjdk.org
Thu Oct 3 00:07:36 UTC 2024
On Tue, 1 Oct 2024 09:21:22 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:
>> Dhamoder Nalla has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Make JVM flag EnableAllLargePageSizesForWindows non-experimental
>
> src/hotspot/os/windows/os_windows.cpp line 3328:
>
>> 3326: }
>> 3327: #if defined(IA32)
>> 3328: if (size > 4 * M || LargePageSizeInBytes > 4 * M) {
>
> Please fix the indentation
Thank you @djelinski for reviewing this PR.
fixed the indentation.
> src/hotspot/os/windows/os_windows.cpp line 3347:
>
>> 3345: }
>> 3346: } else {
>> 3347: WARN("The JVM cannot use large pages because the large page size setting is not configured, defaulting to minimum page size (%d).", size);
>
> This message looks wrong; LargePageSizeInBytes=0 is documented to use the default large page size, and it seems that the surrounding code does just that. Is the warning even necessary?
You are correct; the warning message does seem misleading. The LargePageSizeInBytes=0 is meant to use the default large page size, which the surrounding code already handles. Therefore, the warning about large pages not being configured is unnecessary.
We can remove this warning and adjust the code to reflect the intended use of default large page sizes when
LargePageSizeInBytes is zero.
> src/hotspot/os/windows/os_windows.cpp line 3368:
>
>> 3366:
>> 3367: // Populate _page_sizes with large page sizes less than or equal to _large_page_size, ensuring each page size is double the size of the previous one.
>> 3368: for (size_t page_size = min_size; page_size < _large_page_size; page_size *= 2) {
>
> Does Windows actually use these page sizes, or does it always use 2M pages?
>
> Also, you're only adding powers of 2 here; the user-defined LargePageSizeInBytes doesn't need to be a power of two, and can be 6MB, for example. Will that be a problem?
Windows can use different large page sizes based on hardware support, not limited to the default 2MB. The implementation examines the system's supported page sizes and selects an appropriate size using the LargePageSizeInBytes parameter.
The code accommodates non-power-of-two sizes, such as 6MB, while ensuring these sizes are multiples of the system's minimum large page size to prevent potential issues. If an invalid size is specified, the code defaults to the minimum supported size and issues a warning.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20758#discussion_r1785434481
PR Review Comment: https://git.openjdk.org/jdk/pull/20758#discussion_r1785437011
PR Review Comment: https://git.openjdk.org/jdk/pull/20758#discussion_r1785432873
More information about the hotspot-runtime-dev
mailing list