-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8252973: ZGC: Implement Large Pages support on Windows #1184
Conversation
/label add hotspot-gc |
👋 Welcome back stefank! A progress list of the required criteria for merging this PR into |
@stefank |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Thanks @fisk |
@stefank This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 79 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- LGTM.
- I wanted to add that over the weekend, I took the PR for a spin on my Windows+Arm64 server. I ran SPECJBB2015 in the default (HBIR_RT) and also with PRESET higher IR. Each was run 5 times using the JBB script
:: Number of successive runs set NUM_OF_RUNS=5
and found the run-to-run variance to be less than 2% for all metrics. - I also tested this on an x86-64 with different older versions of Windows. And here's an output from one of them with Windows version < 1803:
[0.018s][error][gc] Failed to lookup symbol: VirtualAlloc2 Error occurred during initialization of VM ZGC requires Windows version 1803 or later
Thanks for reviewing @mo-beck! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Thanks for reviewing! |
@stefank Since your change was applied there have been 177 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 69c3470. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Reviewed-by: eosterlund, mbeckwit, pliden
Please review this patch to add large pages support to ZGC on Windows.
The patch uses a shared AWE section to reserve, commit, and map memory. I've split the code into two implementations, one for the old small pages support, and one for the large pages support. The large pages implementation is chosen if the required APIs are available, memory locking privileges has been setup in Windows (standard requirement for enabling large pages), and the user has selected large pages.
Comparing the small and large pages implementations:
The AWE API requires that the AWE section is provided during the memory reservation stage, and also when committing memory. Previously, ZGC has not needed to share information between the virtual memory layer and the physical memory layer, so there's no straight forward way to pass the section over to the physical memory layer. To keep this dependency local to the Windows implementation, I've chose to use a global reference to the section.
There's no need to use the placeholder API. The placeholders were needed to atomically replace a memory reservation with committed memory and at the same time support memory mapping. The placeholders needed to be dynamically split and coalesced, and some extra infrastructure were added for that. This is not needed with the AWE APIs, and makes that implementation a bit easier to understand IMHO.
When committing memory, the small pages implementation creates one paging file handle per ZGranule (2MB). This allows us to commit/uncommit at arbitrary 2MB boundaries. In the AWE implementation, it's very similar, but whereas the previous implementation chose to use a 2MB boundary, the AWE requires us to keep track of on handle per physical page (2MB again).
The shared AWE memory APIs are available since Windows version 1809. Thanks to Microsoft (@mo-beck and the memory management team) for describing how these APIs could be used to implement the operations we require to support large pages on Windows.
Progress
Testing
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/1184/head:pull/1184
$ git checkout pull/1184