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

8286957: Held monitor count #8945

Closed
wants to merge 9 commits into from
Closed

Conversation

robehn
Copy link
Contributor

@robehn robehn commented May 30, 2022

The current implementation do not count all monitor enter, counts high up in abstraction and causes a performance regression on aarch64 with some benchmarks due to C2 changes.

This change makes the counting exact by pushing the counting down in the abstraction.
The additional JNI counter is strictly not needed, but enables us to figure out if we have monitors "on stack".

An uncontended lock plus unlock is 1 ns (21.5 -> 22.5) slower in C2 compiled code on x64 with the additional increment and decrement.

Fixed aarch64, x64, x86 and zero.

Passes t1-8


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/8945/head:pull/8945
$ git checkout pull/8945

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 8945

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented May 30, 2022

👋 Welcome back rehn! 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 30, 2022

@robehn The following labels will be automatically applied to this pull request:

  • build
  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added build build-dev@openjdk.org hotspot hotspot-dev@openjdk.org labels May 30, 2022
@robehn robehn force-pushed the held-mon-count branch 5 times, most recently from 7aad319 to 8abb563 Compare June 17, 2022 08:41
@robehn
Copy link
Contributor Author

robehn commented Jun 18, 2022

/label remove build

@openjdk openjdk bot removed the build build-dev@openjdk.org label Jun 18, 2022
@openjdk
Copy link

openjdk bot commented Jun 18, 2022

@robehn
The build label was successfully removed.

@robehn robehn marked this pull request as ready for review June 20, 2022 06:51
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 20, 2022
@mlbridge
Copy link

mlbridge bot commented Jun 20, 2022

Webrevs

@openjdk-notifier
Copy link

@robehn Please do not rebase or force-push to an active PR as it invalidates existing review comments. All changes will be squashed into a single commit automatically when integrating. See OpenJDK Developers’ Guide for more information.

@robehn
Copy link
Contributor Author

robehn commented Jun 29, 2022

Thank you @pron !

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. We might however want the counter to be 64 bit so we don't have to think about overflows. I suppose nasty JNI code could lock the entire heap and then unlock it.

@robehn
Copy link
Contributor Author

robehn commented Jul 6, 2022

Looks good. We might however want the counter to be 64 bit so we don't have to think about overflows. I suppose nasty JNI code could lock the entire heap and then unlock it.

Thank you Erik.

I'll go head and change to 64-bit counter.

@robehn
Copy link
Contributor Author

robehn commented Jul 6, 2022

Starting retesting.

@robehn
Copy link
Contributor Author

robehn commented Jul 7, 2022

Incremental changes passed t1-7.

@pron and @fisk can you please have a look if the incremental changes are okay?

And additionally can @pron please take careful look at continuationEntry.hpp and continuationFreezeThaw.cpp

Thanks

@pron
Copy link
Member

pron commented Jul 7, 2022

The changes to continuationEntry.hpp and continuationFreezeThaw.cpp look fine.

@pron
Copy link
Member

pron commented Jul 7, 2022

I would suggest testing all tiers (1-5) in the Loom repo, too.

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.

I could not find any error. Looks good to me.

@openjdk
Copy link

openjdk bot commented Jul 7, 2022

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

8286957: Held monitor count

Reviewed-by: rpressler, 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 41 new commits pushed to the master branch:

  • 3e60e82: 8289301: P11Cipher should not throw out of bounds exception during padding
  • f7b1830: 8289538: Make G1BlockOffsetTablePart unaware of block sizes
  • 5564eff: 8289763: Remove NULL check in CDSProtectionDomain::init_security_info()
  • a694e9e: 8288838: jpackage: file association additional arguments
  • 95e3190: 8210708: Use single mark bitmap in G1
  • 8e7b45b: 8282986: Remove "system" in boot class path names
  • 74ca6ca: 8289800: G1: G1CollectionSet::finalize_young_part clears survivor list too early
  • 86f63f9: 8289164: Convert ResolutionErrorTable to use ResourceHashtable
  • 013a5ee: 8137280: Remove eager reclaim of humongous controls
  • 77ad998: 8289778: ZGC: incorrect use of os::free() for mountpoint string handling after JDK-8289633
  • ... and 31 more: https://git.openjdk.org/jdk/compare/d8f4e97bd3f4e50902e80b4b6b4eb3268c6d4a9d...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 Jul 7, 2022
@robehn
Copy link
Contributor Author

robehn commented Jul 8, 2022

@fisk thank you!

@pron thank you!

It passed loom t1-5 also.

@robehn
Copy link
Contributor Author

robehn commented Jul 8, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Jul 8, 2022

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

  • 1fec62f: 8289710: Move Suspend/Resume classes out of os.hpp
  • 01b9f95: Merge
  • 3212dc9: 8289486: Improve XSLT XPath operators count efficiency
  • a8eb728: 8289779: Map::replaceAll javadoc has redundant @throws clauses
  • 889150b: 8289558: Need spec clarification of j.l.foreign.*Layout
  • 8dd94a2: 8289196: Pattern domination not working properly for record patterns
  • 8f24d25: 6509045: {@inheritdoc} only copies one instance of the specified exception
  • 9a0fa82: 8288949: serviceability/jvmti/vthread/ContStackDepthTest/ContStackDepthTest.java failing
  • 55fa19b: 8289857: ProblemList jdk/jfr/event/runtime/TestActiveSettingEvent.java
  • 32b650c: 8289840: ProblemList vmTestbase/nsk/jdwp/ThreadReference/ForceEarlyReturn/forceEarlyReturn002/forceEarlyReturn002.java when run with vthread wrapper
  • ... and 46 more: https://git.openjdk.org/jdk/compare/d8f4e97bd3f4e50902e80b4b6b4eb3268c6d4a9d...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jul 8, 2022

@robehn Pushed as commit ac399e9.

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

@robehn robehn deleted the held-mon-count branch September 21, 2022 09:33
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
5 participants