RFR: 8266489: Enable G1 to use large pages on Windows when region size is larger than 2m
Thomas Schatzl
tschatzl at openjdk.java.net
Mon May 10 09:24:14 UTC 2021
On Fri, 7 May 2021 20:17:57 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:
> Please review this change to the large page reservation code on Windows to allow G1 to make use of large pages even if the region size is larger than 2m.
>
> **Summary**
> The code handling large pages reservation on Windows fall back to using normal pages if the alignment is larger than the large page size. For G1 this is a problem, because the region size will define the heap alignment which in turn is the alignment used to reserve large pages. This means that for heaps larger than 4G (where the default regions size will be 4m or larger), G1 won't be able to use large pages.
>
> The fix is to handle the case with a larger alignment separately, and first reserve an address that is aligned to the requested alignment, and then use this to reserve the large pages. For the case where there already is a requested address the alignment is not a problem, since that address must already be aligned by the upper layers.
>
> There are two different "ways" to reserve large pages on Windows, one where each page is a separate reservation (used with `UseNUMAInterleaving`) and one where the whole range is a single reservation. I've split those two out into helper functions, since both cases needs to be handled both when finding an aligned address and not. I hope the new code should be fairly easy to follow.
>
> **Testing**
> Manual testing to verify the different cases work. Performance testing to see that we actually get large pages and see an improvement. We do! Currently running some more testing together with `UseNUMAInterleaving` to make sure that works as well.
Lgtm.
-------------
Marked as reviewed by tschatzl (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/3927
More information about the hotspot-gc-dev
mailing list