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

8267186: Add string deduplication support to ZGC #5029

Closed
wants to merge 5 commits into from

Conversation

pliden
Copy link
Contributor

@pliden pliden commented Aug 6, 2021

This change adds support for string deduplication to ZGC. It's a pretty straight forward change, but to make reviewing even easier it is broken up into two commits:

ZGC: Introduce ZMarkContext
This commit just moves the ZMarkCache into the new ZMarkContext class, and we now pass a ZMarkContext* around instead of a ZMarkCache*. The ZMarkContext class is a more general container for worker-local data, which in the next commit will be extended to also include the StringDedup::Requests queue.

8267186: Add string deduplication support to ZGC
This commits adds the actual string dedup functionality and enables relevant tests. We use the deduplication_requested bit in the String object to filter out Strings we've already attempted to deduplicate.

Testing:

  • Passes all string dedup tests.
  • Passes Tier1-7 with ZGC on Linux/x86_64 (with -XX:+UseStringDeduplication enabled by default to get better exposure).

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/5029/head:pull/5029
$ git checkout pull/5029

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5029

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Aug 6, 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
Copy link

@openjdk openjdk bot commented Aug 6, 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 Aug 6, 2021
@pliden pliden marked this pull request as ready for review Aug 6, 2021
@openjdk openjdk bot added the rfr label Aug 6, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Aug 6, 2021

Webrevs

Copy link
Contributor

@fisk fisk left a comment

Now that we have a context object for marking, it would be nice if it also contained the stripes and stacks that we pass around everywhere, that we originally determine just the lines below where the context object is created.

@pliden
Copy link
Contributor Author

@pliden pliden commented Aug 6, 2021

Now that we have a context object for marking, it would be nice if it also contained the stripes and stacks that we pass around everywhere, that we originally determine just the lines below where the context object is created.

Good suggestion, will fix that.

fisk
fisk approved these changes Aug 6, 2021
Copy link
Contributor

@fisk fisk left a comment

Looks good.

@openjdk
Copy link

@openjdk openjdk bot commented Aug 6, 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:

8267186: Add string deduplication support to ZGC

Reviewed-by: eosterlund, kbarrett, 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 81 new commits pushed to the master branch:

  • 5350b99: 8272131: PhaseMacroExpand::generate_slow_arraycopy crash when clone null CallProjections.fallthrough_ioproj
  • 1489352: 8271718: Crash when during color transformation the color profile is replaced
  • 2a9acc3: 8272050: typo in MachSpillCopyNode::implementation after JDK-8131362
  • b62e742: 8213714: AttachingConnector/attach/attach001 failed due to "bind failed: Address already in use"
  • 66d1faa: 8271601: Math.floorMod(int, int) and Math.floorMod(long, long) differ in their logic
  • 57ae9fb: 8140442: Add getOutermostTypeElement to javax.lang.model utility class
  • 67869b4: 8270137: Kerberos Credential Retrieval from Cache not Working in Cross-Realm Setup
  • 35b399a: 8269130: Replace usages of Collection.toArray() with Collection.toArray(T[]) to avoid redundant array copying
  • 2b05fae: 8260262: Use common code in function unmap_shared() in perfMemory_posix.cpp
  • f2599ad: 8272196: Remove unused class ParStrongRootsScope
  • ... and 71 more: https://git.openjdk.java.net/jdk/compare/977b8c4e16b02421de8bf78dc60a3866ce25fc1f...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 Aug 6, 2021
Copy link

@kimbarrett kimbarrett left a comment

Looks good, except for the include order in zMarkContext.inline.hpp.


#include "classfile/javaClasses.inline.hpp"
#include "gc/z/zMarkCache.inline.hpp"
#include "gc/z/zMarkContext.hpp"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The associated .hpp file is supposed to be included first by a .inline.hpp file, per JDK-8267464.

Copy link
Contributor Author

@pliden pliden Aug 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, forgot about that new rule. Fixed.

Copy link
Member

@stefank stefank left a comment

Looks good.

ZMarkContext serves multiple purposes in the marking code, and if we (maybe in the future) add code for those purposes then it risk being a class of multiple responsibilities. Therefore, I think it would be good to let this class be a simpler data carrier, and move the extra code/logic in ZMarkContext::try_deduplicate out to ZMark, or maybe even a new ZStringDedup class.

@pliden
Copy link
Contributor Author

@pliden pliden commented Aug 11, 2021

[...] I think it would be good to let this class be a simpler data carrier, and move the extra code/logic in ZMarkContext::try_deduplicate out to ZMark, or maybe even a new ZStringDedup class.

Fixed.

@pliden
Copy link
Contributor Author

@pliden pliden commented Aug 11, 2021

Thanks @fisk, @kimbarrett and @stefank for reviewing!

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Aug 11, 2021

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

  • 0d0f2d0: 8272216: G1: replace G1ParScanThreadState::_dest with a constant
  • 3215dbc: 8271928: ErroneousTree with start position -1
  • adba09b: 8272146: Disable Fibonacci test on memory constrained systems
  • 846cc88: 8272138: ZGC: Adopt relaxed ordering for self-healing
  • 5350b99: 8272131: PhaseMacroExpand::generate_slow_arraycopy crash when clone null CallProjections.fallthrough_ioproj
  • 1489352: 8271718: Crash when during color transformation the color profile is replaced
  • 2a9acc3: 8272050: typo in MachSpillCopyNode::implementation after JDK-8131362
  • b62e742: 8213714: AttachingConnector/attach/attach001 failed due to "bind failed: Address already in use"
  • 66d1faa: 8271601: Math.floorMod(int, int) and Math.floorMod(long, long) differ in their logic
  • 57ae9fb: 8140442: Add getOutermostTypeElement to javax.lang.model utility class
  • ... and 75 more: https://git.openjdk.java.net/jdk/compare/977b8c4e16b02421de8bf78dc60a3866ce25fc1f...master

Your commit was automatically rebased without conflicts.

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

@openjdk openjdk bot commented Aug 11, 2021

@pliden Pushed as commit abebbe2.

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

@pliden pliden deleted the 8267186_zgc_string_dedup branch Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-gc integrated
4 participants