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

8331714: Make OopMapCache installation lock-free #19100

Closed

Conversation

shipilev
Copy link
Member

@shipilev shipilev commented May 6, 2024

Trying to solve JDK-8331572 runs into all sorts of lock ranking issues with OopMapCacheAlloc_lock. I think it would be a bit saner to rewrite the double-checked locking installation to atomic lock-free. OpenJDK code was using this lock since the initial load.

There is a drawback that we might be trying to instantiate multiple OopMapCache instances from multiple threads. I think this is not a practical problem, as only a few threads would race here, and the allocation is relatively small (32*8 = 512 bytes). In imaginary worst^W nightmare case, with 100K threads racing we get a temporary native memory spike at +50M.

Additional testing:

  • Linux x86_64 server fastdebug, all tests

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-8331714: Make OopMapCache installation lock-free (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 19100

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 6, 2024

👋 Welcome back shade! 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 May 6, 2024

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

8331714: Make OopMapCache installation lock-free

Reviewed-by: zgu, coleenp

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

  • a8b3f19: 8330077: Allow max number of events to be buffered to be configurable to avoid OVERFLOW_EVENT
  • ae60d84: 8328501: Incorrect @since tags for java security interfaces
  • 7a35f92: 8331660: Parallel: Cleanup includes in parallelScavangeHeap files
  • fa02667: 8322726: C2: Unloaded signature class kills argument value
  • a8e62af: 8331389: runtime/ErrorHandling/TestDwarf.java fails with "Crash JVM should not exit gracefully"
  • 1eec30a: 8331573: Rename CollectedHeap::is_gc_active to be explicitly about STW GCs
  • e8a2d56: 8331653: JFR: Improve logging for jdk/jfr/api/consumer/recordingstream;TestStop.java
  • 9b0bb03: 8331285: Deprecate and obsolete OldSize
  • 6c77641: 8331418: ZGC: generalize barrier liveness logic
  • 15862a2: 8331708: jdk/internal/jline/RedirectedStdOut.java times-out on macosx-aarch64
  • ... and 38 more: https://git.openjdk.org/jdk/compare/553d45b11460a794613651373f34c8379c11729b...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 rfr Pull request is ready for review label May 6, 2024
@openjdk
Copy link

openjdk bot commented May 6, 2024

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

  • hotspot

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 hotspot-dev@openjdk.org label May 6, 2024
@mlbridge
Copy link

mlbridge bot commented May 6, 2024

Webrevs

Copy link
Contributor

@zhengyu123 zhengyu123 left a comment

Choose a reason for hiding this comment

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

LGTM. Very similar to what I made in PR #16074

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 6, 2024
Copy link
Contributor

@coleenp coleenp left a comment

Choose a reason for hiding this comment

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

This seems completely reasonable.

@shipilev
Copy link
Member Author

shipilev commented May 7, 2024

Thanks!

/integrate

@openjdk
Copy link

openjdk bot commented May 7, 2024

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

  • df1ff05: 8331085: Crash in MergePrimitiveArrayStores::is_compatible_store()
  • 3b8227b: 8326836: Incorrect @since tags for ClassSignature methods
  • f308e10: 8331400: AArch64: Sync aarch64_vector.ad with aarch64_vector_ad.m4
  • a8b3f19: 8330077: Allow max number of events to be buffered to be configurable to avoid OVERFLOW_EVENT
  • ae60d84: 8328501: Incorrect @since tags for java security interfaces
  • 7a35f92: 8331660: Parallel: Cleanup includes in parallelScavangeHeap files
  • fa02667: 8322726: C2: Unloaded signature class kills argument value
  • a8e62af: 8331389: runtime/ErrorHandling/TestDwarf.java fails with "Crash JVM should not exit gracefully"
  • 1eec30a: 8331573: Rename CollectedHeap::is_gc_active to be explicitly about STW GCs
  • e8a2d56: 8331653: JFR: Improve logging for jdk/jfr/api/consumer/recordingstream;TestStop.java
  • ... and 41 more: https://git.openjdk.org/jdk/compare/553d45b11460a794613651373f34c8379c11729b...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented May 7, 2024

@shipilev Pushed as commit a2584a8.

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

Successfully merging this pull request may close these issues.

3 participants