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

8314551: More generic way to handshake GC threads with monitor deflation #15336

Closed
wants to merge 1 commit into from

Conversation

rkennke
Copy link
Contributor

@rkennke rkennke commented Aug 17, 2023

We currently handshake GC threads with monitor deflation by calling SuspendibleThreadSet::synchronize() and SuspendibleThreadSet::desynchronize(). This is somewhat problematic though, because GCs may use other mechanisms to sync their GC threads. In particular, ZGC uses ZRelocateQueue to do that.

Luckily, CollectedHeap comes with interfaces for exactly this purpose: CollectedHeap::safepoint_synchronize_begin() and CollectedHeap::safepoint_synchronize_end(). Those methods are implemented by ZGC to do the correct synchronization with ZRelocateQueue. All GCs which need that sort of synchronization are overriding these methods and delegate to STS methods, so we can replace the STS calls with the CollectedHeap calls.

Testing:

  • hotspot_gc
  • tier1

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

  • JDK-8314551: More generic way to handshake GC threads with monitor deflation (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 15336

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 17, 2023

👋 Welcome back rkennke! 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 17, 2023
@openjdk
Copy link

openjdk bot commented Aug 17, 2023

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

  • hotspot-runtime

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-runtime hotspot-runtime-dev@openjdk.org label Aug 17, 2023
@mlbridge
Copy link

mlbridge bot commented Aug 17, 2023

Webrevs

Copy link
Contributor

@jdksjolen jdksjolen left a comment

Choose a reason for hiding this comment

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

Hi Roman,

This change looks good to me. I've asked for input from GC in case there are any considerations that are easily missed when only reading the surrounding code.

@openjdk
Copy link

openjdk bot commented Sep 4, 2023

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

8314551: More generic way to handshake GC threads with monitor deflation

Reviewed-by: jsjolen, eosterlund

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

  • 6c821f5: 8315545: C1: x86 cmove can use short branches
  • d7e4087: 8315369: [JVMCI] failure to attach to a libgraal isolate during shutdown should not be fatal
  • d1cabe4: 8315566: [JVMCI] deadlock in JVMCI startup when bad option specified
  • 94a74a0: 8315534: Incorrect warnings about implicit annotation processing
  • 84425a6: 8315452: Erroneous AST missing modifiers for partial input
  • 3094fd1: 8314662: jshell shows duplicated signatures of javap
  • 0d52c82: 8310220: IGV: dump graph after each IGVN step at level 4
  • adfc1d6: 8313323: javac -g on a java file which uses unnamed variable leads to ClassFormatError when launching that class
  • 2dc930d: 8314997: Missing optimization opportunities due to missing try_clean_mem_phi() calls
  • ab12c5d: 8315549: CITime misreports code/total nmethod sizes
  • ... and 173 more: https://git.openjdk.org/jdk/compare/808bb1f7bc5025b4ab01e4e9057feebd253b95a7...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 Pull request is ready to be integrated label Sep 4, 2023
@rkennke
Copy link
Contributor Author

rkennke commented Sep 15, 2023

Thanks!
/integrate

@openjdk
Copy link

openjdk bot commented Sep 15, 2023

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

  • 89cb290: 8312165: Fix typos in java.desktop Swing
  • 25f32f3: 8316160: Remove sun.misc.Unsafe.{shouldBeInitialized,ensureClassInitialized}
  • 86dde5e: 8316001: GC: Make TestArrayAllocatorMallocLimit use createTestJvm
  • 4f864fa: 8314136: Test java/net/httpclient/CancelRequestTest.java failed: WARNING: tracker for HttpClientImpl(42) has outstanding operations
  • 4070829: 8315931: RISC-V: xxxMaxVectorTestsSmokeTest fails when using RVV
  • d575968: 8316178: Better diagnostic header for CodeBlobs
  • bfbc41c: 8315741: Open source few swing JFormattedTextField and JPopupMenu tests
  • 0775bf2: 8316106: Open source few swing JInternalFrame and JMenuBar tests
  • 4a63eb0: 8315834: Open source several Swing JSpinner related tests
  • 8dc2d92: 8316190: Improve MemorySegment::toString
  • ... and 339 more: https://git.openjdk.org/jdk/compare/808bb1f7bc5025b4ab01e4e9057feebd253b95a7...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Sep 15, 2023

@rkennke Pushed as commit 31c4e03.

💡 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-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated
3 participants