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

8276055: ZGC: Defragment address space #6137

Closed

Conversation

pliden
Copy link
Contributor

@pliden pliden commented Oct 27, 2021

In ZGC, small pages are allocated from the beginning of the address space (low addresses), while medium and large pages are allocated from the end of the address space (high addresses). However, small pages can sometimes end up on a high address if a medium or a large page was split into small pages. Over time this can cause the address space to become fragmented, with the risk of eventually running out of address space for new large allocations.

To mitigate this, we can defragment the address space by letting small pages at high addresses be remapped to lower addresses. That's what this patch does.

Testing:

  • Tier 1-7 with ZGC on Linux/x86_64
  • SPECjbb2015 shows no regression
  • Manually ran test that tries to fragment the address space

Progress

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

Issue

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6137

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Oct 27, 2021

👋 Welcome back pliden! 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 openjdk bot added the rfr label Oct 27, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Oct 27, 2021

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

  • hotspot-gc

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-gc label Oct 27, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Oct 27, 2021

Webrevs

@mlbridge
Copy link

@mlbridge mlbridge bot commented Oct 27, 2021

Mailing list message from Stefan Karlsson on hotspot-gc-dev:

Looks good!

StefanK

On 2021-10-27 14:19, Per Liden wrote:

fisk
fisk approved these changes Oct 27, 2021
Copy link
Contributor

@fisk fisk left a comment

Looks good.

@openjdk
Copy link

@openjdk openjdk bot commented Oct 27, 2021

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

8276055: ZGC: Defragment address space

Reviewed-by: eosterlund, stefank

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

  • e6fa5fa: 8276063: ProblemList gtest dll_address_to_function_and_library_name on macosx-generic
  • 809488b: 8276046: codestrings.validate_vm gtest fails on ppc64, s390
  • 93be099: 4718400: Many quantities are held as signed that should be unsigned
  • 168081e: 8270490: Charset.forName() taking fallback default value
  • a292733: 8275975: Remove dead code in ciInstanceKlass
  • 4060602: 8275800: Redefinition leaks MethodData::_extra_data_lock
  • 485d658: 8275851: Deproblemlist open/test/jdk/javax/swing/JComponent/6683775/bug6683775.java
  • b3f45f8: 8275689: [TESTBUG] Use color tolerance only for XRender in BlitRotateClippedArea test
  • 6c05cc9: 8275863: Use encodeASCII for ASCII-compatible DoubleByte encodings
  • 2f979ec: 8213120: java/awt/TextArea/AutoScrollOnSelectAndAppend/AutoScrollOnSelectAndAppend.java fails on mac10.13
  • ... and 1 more: https://git.openjdk.java.net/jdk/compare/9f75d5ce500886b32175cc541939b7f0eee190ca...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 label Oct 27, 2021
@pliden
Copy link
Contributor Author

@pliden pliden commented Oct 27, 2021

Renamed a few functions after off-line discussion with @stefank and @fisk.

fisk
fisk approved these changes Oct 27, 2021
@pliden
Copy link
Contributor Author

@pliden pliden commented Oct 28, 2021

Thanks for reviewing!

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Oct 28, 2021

Going to push as commit 1750a6e.
Since your change was applied there have been 13 commits pushed to the master branch:

  • d9b0138: 8275704: Metaspace::contains() should be threadsafe
  • 9a3e954: 8274879: Replace uses of StringBuffer with StringBuilder within java.base classes
  • e6fa5fa: 8276063: ProblemList gtest dll_address_to_function_and_library_name on macosx-generic
  • 809488b: 8276046: codestrings.validate_vm gtest fails on ppc64, s390
  • 93be099: 4718400: Many quantities are held as signed that should be unsigned
  • 168081e: 8270490: Charset.forName() taking fallback default value
  • a292733: 8275975: Remove dead code in ciInstanceKlass
  • 4060602: 8275800: Redefinition leaks MethodData::_extra_data_lock
  • 485d658: 8275851: Deproblemlist open/test/jdk/javax/swing/JComponent/6683775/bug6683775.java
  • b3f45f8: 8275689: [TESTBUG] Use color tolerance only for XRender in BlitRotateClippedArea test
  • ... and 3 more: https://git.openjdk.java.net/jdk/compare/9f75d5ce500886b32175cc541939b7f0eee190ca...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Oct 28, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Oct 28, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Oct 28, 2021

@pliden Pushed as commit 1750a6e.

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

@pliden pliden deleted the 8276055_zgc_defragment_address_space branch Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-gc integrated
3 participants