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

8276205: Shenandoah: CodeCache_lock should always be held for initializing code cache iteration #262

Closed

Conversation

zhengyu123
Copy link
Contributor

@zhengyu123 zhengyu123 commented Nov 15, 2021

I would like to backport this Shenandoah specific fix to jdk17u.

This patch fixed the bug that not holding CodeCache_lock while initializing concurrent nmethod iterations, that can lead to miscount number of concurrent walker and result assertion failure.

The patch fixed a bug that prevents iterators from walking nmethod concurrently due to holding CodeCache_lock during the walk.

The original patch does not apply cleanly, due to context changes. But the patch is small and simple, conflicts can be easily resolved manually.

Test:

  • hotspot_gc_shenandoah

Progress

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

Issue

  • JDK-8276205: Shenandoah: CodeCache_lock should always be held for initializing code cache iteration

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 262

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Nov 15, 2021

👋 Welcome back zgu! 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 changed the title Backport 99b7b95e014da6e491ba7adfd21de53d6ae166fe 8276205: Shenandoah: CodeCache_lock should always be held for initializing code cache iteration Nov 15, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Nov 15, 2021

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport rfr labels Nov 15, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Nov 15, 2021

Webrevs

Copy link
Contributor

@shipilev shipilev left a comment

So the "context" difference is that JDK 17u does not have JDK-8273300, which removed CodeCache_lock from ShenandoahCodeRootsIterator? If so, looks fine.

@openjdk
Copy link

@openjdk openjdk bot commented Nov 17, 2021

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

8276205: Shenandoah: CodeCache_lock should always be held for initializing code cache iteration

Reviewed-by: shade

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

  • 95573d4: 8268882: C2: assert(n->outcnt() != 0 || C->top() == n || n->is_Proj()) failed: No dead instructions after post-alloc
  • f9eed14: 8275766: (tz) Update Timezone Data to 2021e
  • 816b5cd: 8263059: security/infra/java/security/cert/CertPathValidator/certification/ComodoCA.java fails due to revoked cert
  • e5c70af: 8276854: Windows GHA builds fail due to broken Cygwin
  • e8eec1f: 8273595: tools/jpackage tests do not work on apt-based Linux distros like Debian
  • 9ff9e62: 8271315: Redo: Nimbus JTree renderer properties persist across L&F changes
  • e7e83d5: 8272369: java/io/File/GetXSpace.java failed with "RuntimeException: java.nio.file.NoSuchFileException: /run/user/0"
  • 1d11bcd: 8273486: Zero: Handle DiagnoseSyncOnValueBasedClasses VM option
  • 95726bf: 8276105: C2: Conv(D|F)2(I|L)Nodes::Ideal should handle rounding correctly
  • 93d8337: 8276846: JDK-8273416 is incomplete for UseSSE=1
  • ... and 7 more: https://git.openjdk.java.net/jdk17u/compare/c3de885179fb77d9b502d3e33c0f5f63b00c631d...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 Nov 17, 2021
@zhengyu123
Copy link
Contributor Author

@zhengyu123 zhengyu123 commented Nov 17, 2021

So the "context" difference is that JDK 17u does not have JDK-8273300, which removed CodeCache_lock from ShenandoahCodeRootsIterator? If so, looks fine.

Yes.

Thanks for the review, @shipilev

@zhengyu123
Copy link
Contributor Author

@zhengyu123 zhengyu123 commented Nov 17, 2021

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Nov 17, 2021

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

  • 95573d4: 8268882: C2: assert(n->outcnt() != 0 || C->top() == n || n->is_Proj()) failed: No dead instructions after post-alloc
  • f9eed14: 8275766: (tz) Update Timezone Data to 2021e
  • 816b5cd: 8263059: security/infra/java/security/cert/CertPathValidator/certification/ComodoCA.java fails due to revoked cert
  • e5c70af: 8276854: Windows GHA builds fail due to broken Cygwin
  • e8eec1f: 8273595: tools/jpackage tests do not work on apt-based Linux distros like Debian
  • 9ff9e62: 8271315: Redo: Nimbus JTree renderer properties persist across L&F changes
  • e7e83d5: 8272369: java/io/File/GetXSpace.java failed with "RuntimeException: java.nio.file.NoSuchFileException: /run/user/0"
  • 1d11bcd: 8273486: Zero: Handle DiagnoseSyncOnValueBasedClasses VM option
  • 95726bf: 8276105: C2: Conv(D|F)2(I|L)Nodes::Ideal should handle rounding correctly
  • 93d8337: 8276846: JDK-8273416 is incomplete for UseSSE=1
  • ... and 7 more: https://git.openjdk.java.net/jdk17u/compare/c3de885179fb77d9b502d3e33c0f5f63b00c631d...master

Your commit was automatically rebased without conflicts.

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

@openjdk openjdk bot commented Nov 17, 2021

@zhengyu123 Pushed as commit f1a8a22.

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