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

8298376: ZGC: thaws stackChunk with stale oops #11585

Closed

Conversation

stefank
Copy link
Member

@stefank stefank commented Dec 8, 2022

During the recent ZGC + Loom rewrites JDK-8296875 a bug was introduced, which causes Loom to thaw stackChunks with stale oops.

Before that change we made sure that only the GC performed load barriers on the cont oop in stackChunk, so that we could use the oop state as an indication of the age of the stackChunk. That information was then used in ZCollectedHeap::requires_barriers.

In Generational ZGC we changed the implementation of requires_barriers, so that the rest of the JVM didn't need to have special-handling of the cont oop. However, when upstreaming the changes in JDK-8296875 we purposefully didn't update requires_barriers, but we incorrectly brought over the removal of the special-handling of the cont oop.

To limit the fix for this bug, I propose that we restore the special-handling of the cont oop.

I've tested this with a reproducer running Fuzz.java + ZGC.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11585/head:pull/11585
$ git checkout pull/11585

Update a local copy of the PR:
$ git checkout pull/11585
$ git pull https://git.openjdk.org/jdk pull/11585/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 11585

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11585.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 8, 2022

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

@stefank
Copy link
Member Author

stefank commented Dec 8, 2022

/label add hotspot

@openjdk openjdk bot added rfr Pull request is ready for review hotspot hotspot-dev@openjdk.org labels Dec 8, 2022
@openjdk
Copy link

openjdk bot commented Dec 8, 2022

@stefank
The hotspot label was successfully added.

@mlbridge
Copy link

mlbridge bot commented Dec 8, 2022

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.

Copy link
Contributor

@pchilano pchilano 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, thanks for adding the comment.

@stefank stefank changed the base branch from pr/11582 to master December 14, 2022 11:07
@openjdk
Copy link

openjdk bot commented Dec 14, 2022

⚠️ @stefank This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

@openjdk
Copy link

openjdk bot commented Dec 14, 2022

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

8298376: ZGC: thaws stackChunk with stale oops

Reviewed-by: eosterlund, pchilanomate

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 Dec 14, 2022
@coleenp
Copy link
Contributor

coleenp commented Dec 14, 2022

Should this be fixed for JDK 20?

@stefank
Copy link
Member Author

stefank commented Dec 14, 2022

Should this be fixed for JDK 20?

Yes. I'll backport this after pushing to 21.

@stefank
Copy link
Member Author

stefank commented Dec 14, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Dec 14, 2022

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

  • 2e801e1: 8298475: Remove JVM_ACC_PROMOTED_FLAGS
  • 9ee5037: 8298636: Fix return value in WB_CountAliveClasses and WB_GetSymbolRefcount
  • ceca4fc: 8298264: Merge OffsetTableContigSpace into TenuredSpace
  • d32d6c0: 8297791: update _max_classes in node type system

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 14, 2022
@openjdk openjdk bot closed this Dec 14, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 14, 2022
@openjdk
Copy link

openjdk bot commented Dec 14, 2022

@stefank Pushed as commit ed8a212.

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

@stefank
Copy link
Member Author

stefank commented Dec 15, 2022

/backport jdk20

@openjdk
Copy link

openjdk bot commented Dec 15, 2022

@stefank the backport was successfully created on the branch stefank-backport-ed8a2120 in my personal fork of openjdk/jdk20. To create a pull request with this backport targeting openjdk/jdk20:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit ed8a2120 from the openjdk/jdk repository.

The commit being backported was authored by Stefan Karlsson on 14 Dec 2022 and was reviewed by Erik Österlund and Patricio Chilano Mateo.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk20:

$ git fetch https://github.com/openjdk-bots/jdk20 stefank-backport-ed8a2120:stefank-backport-ed8a2120
$ git checkout stefank-backport-ed8a2120
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk20 stefank-backport-ed8a2120

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

Successfully merging this pull request may close these issues.

4 participants