Skip to content
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

8266489: Enable G1 to use large pages on Windows when region size is larger than 2m #3927

Closed
wants to merge 1 commit into from

Conversation

kstefanj
Copy link
Contributor

@kstefanj kstefanj commented May 7, 2021

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.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8266489: Enable G1 to use large pages on Windows when region size is larger than 2m

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3927/head:pull/3927
$ git checkout pull/3927

Update a local copy of the PR:
$ git checkout pull/3927
$ git pull https://git.openjdk.java.net/jdk pull/3927/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3927

View PR using the GUI difftool:
$ git pr show -t 3927

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3927.diff

@bridgekeeper
Copy link

bridgekeeper bot commented May 7, 2021

👋 Welcome back sjohanss! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented May 7, 2021

@kstefanj The following label will be automatically applied to this pull request:

  • hotspot-runtime

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label May 7, 2021
@kstefanj
Copy link
Contributor Author

kstefanj commented May 7, 2021

/label remove hotspot-runtime
/label add hotspot-gc

@openjdk openjdk bot removed the hotspot-runtime hotspot-runtime-dev@openjdk.org label May 7, 2021
@openjdk
Copy link

openjdk bot commented May 7, 2021

@kstefanj
The hotspot-runtime label was successfully removed.

@openjdk openjdk bot added the hotspot-gc hotspot-gc-dev@openjdk.org label May 7, 2021
@openjdk
Copy link

openjdk bot commented May 7, 2021

@kstefanj
The hotspot-gc label was successfully added.

@kstefanj kstefanj marked this pull request as ready for review May 7, 2021
@openjdk openjdk bot added the rfr Pull request is ready for review label May 7, 2021
@mlbridge
Copy link

mlbridge bot commented May 7, 2021

Webrevs

Copy link
Contributor

@tschatzl tschatzl left a comment

Lgtm.

@openjdk
Copy link

openjdk bot commented May 10, 2021

@kstefanj 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:

8266489: Enable G1 to use large pages on Windows when region size is larger than 2m

Reviewed-by: tschatzl, iwalulya

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 112 new commits pushed to the master branch:

  • f422787: 8266073: Regression ~2% in Derby after 8261804
  • 02f895c: 8252685: APIs that require JavaThread should take JavaThread arguments
  • 2066f49: 8266764: [REDO] JDK-8255493 Support for pre-generated java.lang.invoke classes in CDS dynamic archive
  • 8c71144: 8265153: add time based test for ThreadMXBean.getThreadInfo() and ThreadInfo.getLockOwnerName()
  • 10cafd2: 8267153: Problemlist jdk/jfr/event/gc/collection/TestG1ParallelPhases.java to remove the noise from CI
  • f3fb5a4: 8266942: gtest/GTestWrapper.java os.iso8601_time_vm failed
  • 7ab6dc8: 6676643: Improve current C_GetAttributeValue native implementation
  • 28f1c7a: 8249395: (macos) jpackage tests timeout on MacPro5_1 systems
  • be0a655: 8254598: StringDedupTable should use OopStorage
  • 360928d: 8260046: Assert left >= right in pointer_delta() methods
  • ... and 102 more: https://git.openjdk.java.net/jdk/compare/2798b0d98ab4191fc94e210d57422854cf13f11e...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 10, 2021
@kstefanj
Copy link
Contributor Author

kstefanj commented May 17, 2021

Thanks @tschatzl and @walulyai for the reviews.

/integrate

@openjdk openjdk bot closed this May 17, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels May 17, 2021
@openjdk
Copy link

openjdk bot commented May 17, 2021

@kstefanj Since your change was applied there have been 112 commits pushed to the master branch:

  • f422787: 8266073: Regression ~2% in Derby after 8261804
  • 02f895c: 8252685: APIs that require JavaThread should take JavaThread arguments
  • 2066f49: 8266764: [REDO] JDK-8255493 Support for pre-generated java.lang.invoke classes in CDS dynamic archive
  • 8c71144: 8265153: add time based test for ThreadMXBean.getThreadInfo() and ThreadInfo.getLockOwnerName()
  • 10cafd2: 8267153: Problemlist jdk/jfr/event/gc/collection/TestG1ParallelPhases.java to remove the noise from CI
  • f3fb5a4: 8266942: gtest/GTestWrapper.java os.iso8601_time_vm failed
  • 7ab6dc8: 6676643: Improve current C_GetAttributeValue native implementation
  • 28f1c7a: 8249395: (macos) jpackage tests timeout on MacPro5_1 systems
  • be0a655: 8254598: StringDedupTable should use OopStorage
  • 360928d: 8260046: Assert left >= right in pointer_delta() methods
  • ... and 102 more: https://git.openjdk.java.net/jdk/compare/2798b0d98ab4191fc94e210d57422854cf13f11e...master

Your commit was automatically rebased without conflicts.

Pushed as commit 7b736ec.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-gc hotspot-gc-dev@openjdk.org integrated Pull request has been integrated
3 participants