Skip to content

Conversation

@stefank
Copy link
Member

@stefank stefank commented Aug 13, 2021

Please review this patch to remove load barriers from the "raw" version of UnsafeGet.

After rebasing the ZGC Generational code to latest openjdk/jdk we hit a crash because a load barrier was generated for some oops that are not supposed to have a load barrier. In upstream ZGC this isn't a problem because these load barriers are just redundant and will find healed good oops. However, in the Generational version un-barriered roots (e.g. thread stacks) have no metadata bits, and we should never perform normal load barriers on them (they are handled by stack watermarks and nmethod barriers).

This load barrier was introduced with:
JDK-8266746: C1: Replace UnsafeGetRaw with UnsafeGet when setting up OSR entry block

which makes UnsafeGet also handle "raw" loads. However, the "raw" path introduced a load barrier. Note that "raw" is often used to denote a function that loads/stores values without using a barrier.

I've tested this with tier1-3 and have had some initial set of eyes looking over the patch, but it would be good to scrutinize this patch and the usage of UnsafeGet in GraphBuilder::setup_osr_entry_block.

@TheRealMDoerr could you check if this patch works with PPC?


Progress

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

Issue

  • JDK-8272446: C1: Raw version of UnsafeGet generates load barriers

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5109

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 13, 2021

👋 Welcome back stefank! 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 Pull request is ready for review label Aug 13, 2021
@openjdk
Copy link

openjdk bot commented Aug 13, 2021

@stefank 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 hotspot-compiler-dev@openjdk.org label Aug 13, 2021
@mlbridge
Copy link

mlbridge bot commented Aug 13, 2021

Webrevs

Copy link
Contributor

@fisk fisk left a comment

Choose a reason for hiding this comment

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

Looks good.

@openjdk
Copy link

openjdk bot commented Aug 13, 2021

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

8272446: C1: Raw version of UnsafeGet generates load barriers

Reviewed-by: eosterlund, iveresov

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential 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 Aug 13, 2021
Copy link
Contributor

@veresov veresov left a comment

Choose a reason for hiding this comment

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

Looks good.

@stefank
Copy link
Member Author

stefank commented Aug 16, 2021

@fisk @veresov Thanks for reviewing!

@stefank
Copy link
Member Author

stefank commented Aug 17, 2021

/integrate

@openjdk
Copy link

openjdk bot commented Aug 17, 2021

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

  • 989f39f: 8272552: mark hotspot runtime/cds tests which ignore external VM flags
  • ee8bf10: 8272327: Shenandoah: Avoid enqueuing duplicate string candidates
  • 3fb1927: 8271227: Missing {@code } in com.sun.source.*
  • a5ad772: 8272342: [TEST_BUG] java/awt/print/PrinterJob/PageDialogMarginTest.java catches all exceptions
  • ae45592: 8272374: doclint should report missing "body" comments
  • b2c272d: 8272305: several hotspot runtime/modules don't check exit codes
  • 8268825: 8272297: FileInputStream should override transferTo() for better performance
  • 3677734: 8271471: [IR Framework] Rare occurrence of "" in PrintIdeal/PrintOptoAssembly can let tests fail
  • 0a03481: 8272231: G1: Refactor G1CardSet::get_card_set to return G1CardSetHashTableValue*
  • 83d0e12: 8267833: Improve G1CardSetInlinePtr::add()

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Aug 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 Aug 17, 2021
@openjdk
Copy link

openjdk bot commented Aug 17, 2021

@stefank Pushed as commit df1427b.

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

@stefank stefank deleted the 8272446_UnsafeGet_raw_load_barrier branch January 12, 2022 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants