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

8223923: C2: Missing interference with mismatched unsafe accesses #5146

Closed
wants to merge 1 commit into from

Conversation

iwanowww
Copy link

@iwanowww iwanowww commented Aug 17, 2021

Memory effects of mixed or mismatched unsafe accesses aren't properly tracked, so every problematic access is wrapped into a pair of MemBarCPUOrder nodes to isolate it from the rest of the memory graph. But MemNode::can_see_stored_value() unconditionally steps over MemBarCPUOrder and exposes problematic MergeMem nodes.

Proposed fix forbids stepping over MemBarCPUOrder nodes when looking for an earlier store into the same location.

Alternatively, a new kind of barrier could be introduced specifically for isolation purposes, but I didn't spot any issues during performance testing with the current patch to justify more complex solution.

Testing: hs-tier1 - hs-tier6, performance testing.


Progress

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

Issue

  • JDK-8223923: C2: Missing interference with mismatched unsafe accesses

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5146

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 17, 2021

👋 Welcome back vlivanov! 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 Aug 17, 2021

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

  • hotspot-compiler

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

mlbridge bot commented Aug 17, 2021

Webrevs

Copy link
Member

@TobiHartmann TobiHartmann left a comment

That looks reasonable to me.

@openjdk
Copy link

openjdk bot commented Aug 18, 2021

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

8223923: C2: Missing interference with mismatched unsafe accesses

Reviewed-by: thartmann

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

  • 5189047: 8272558: IR Test Framework README misses some flags
  • ec63957: 8272398: Update DockerTestUtils.buildJdkDockerImage()
  • 14623cd: 8270835: regression after JDK-8261006
  • fe72197: 8272551: mark hotspot runtime/modules tests which ignore external VM flags
  • 05d64da: 8272291: mark hotspot runtime/logging tests which ignore external VM flags
  • a68b5b9: 8272369: java/io/File/GetXSpace.java failed with "RuntimeException: java.nio.file.NoSuchFileException: /run/user/0"
  • a199ebc: 8272581: sun/security/pkcs11/Provider/MultipleLogins.sh fails after JDK-8266182
  • 1cbf41a: 8225083: Remove Google certificate that is expiring in December 2021
  • cf64c3e: 8272326: java/util/Random/RandomTestMoments.java had two Gaussian fails
  • 2ed7b70: 8272521: Remove unused PSPromotionManager::_claimed_stack_breadth
  • ... and 2 more: https://git.openjdk.java.net/jdk/compare/0e3fde6c3c2f5c05777b79ff5eb1188014269b0f...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 18, 2021
@iwanowww
Copy link
Author

iwanowww commented Aug 20, 2021

Thanks for the review, Tobias.

/integrate

@openjdk
Copy link

openjdk bot commented Aug 20, 2021

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

  • c701f6e: 8272739: Misformatted error message in EventHandlerCreator
  • fb1dfc6: 8267185: Add string deduplication support to ParallelGC
  • d874e96: 8271579: G1: Move copy before CAS in do_copy_to_survivor_space
  • 92bde67: 8271946: Cleanup leftovers in Space and subclasses
  • db9834f: 8258951: java/net/httpclient/HandshakeFailureTest.java failed with "RuntimeException: Not found expected SSLHandshakeException in java.io.IOException"
  • a81e5e9: 8272654: Mark word accesses should not use Access API
  • 4bd37c3: 8272708: [Test]: Cleanup: test/jdk/security/infra/java/security/cert/CertPathValidator/certification/BuypassCA.java no longer needs ocspEnabled
  • ddcd851: 8272602: [macos] not all KEY_PRESSED events sent when control modifier is used
  • d007be0: 8272700: [macos] Build failure with Xcode 13.0 after JDK-8264848
  • f4be211: 8270041: Consolidate oopDesc::cas_forward_to() and oopDesc::forward_to_atomic()
  • ... and 28 more: https://git.openjdk.java.net/jdk/compare/0e3fde6c3c2f5c05777b79ff5eb1188014269b0f...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Aug 20, 2021

@iwanowww Pushed as commit 86add21.

💡 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-compiler integrated
2 participants