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

8332610: Remove unused nWakeups in ObjectMonitor #19326

Closed
wants to merge 4 commits into from

Conversation

jdksjolen
Copy link
Contributor

@jdksjolen jdksjolen commented May 21, 2024

Hi,

This comment only serves to confuse people, as nWakeups is not shared between threads and never read. It is probably meant for debugging (not sure). Let's delete the comment.


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-8332610: Remove unused nWakeups in ObjectMonitor (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 19326

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 21, 2024

👋 Welcome back jsjolen! 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 21, 2024

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

8332610: Remove unused nWakeups in ObjectMonitor

Reviewed-by: coleenp, dcubed

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

  • 4f1a10f: 8332360: JVM hangs at exit when running on a uniprocessor
  • c3bc23f: 8326306: RISC-V: Re-structure MASM calls and jumps
  • 8a9d77d: 8320622: [TEST] Improve coverage of compiler/loopopts/superword/TestMulAddS2I.java on different platforms
  • 3d511ff: 8329748: Change default value of AssertWXAtThreadSync to true
  • 67f03f2: 8332533: RISC-V: Enable vector variable shift instructions for machines with RVV
  • 5f804b2: 8329825: Clarify the value type for java.net.SocketOptions.SO_LINGER
  • 52eda79: 8332538: Switch off JIT memory limit check for TestAlignVectorFuzzer.java
  • d999b81: 8331572: Allow using OopMapCache outside of STW GC phases
  • 8291c94: 8331224: ClassCastException in ObjectInputStream hides ClassNotFoundException
  • 42e3c84: 8332086: Remove the usage of ServiceLoader in j.u.r.RandomGeneratorFactory
  • ... and 19 more: https://git.openjdk.org/jdk/compare/b92bd671835c37cff58e2cdcecd0fe4277557d7f...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 changed the title 8332610 8332610: Remove confusing comment in ObjectMonitor::ReenterI May 21, 2024
@openjdk openjdk bot added the rfr Pull request is ready for review label May 21, 2024
@openjdk
Copy link

openjdk bot commented May 21, 2024

@jdksjolen 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 May 21, 2024
@mlbridge
Copy link

mlbridge bot commented May 21, 2024

Webrevs

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.

Please remove that unused variable also in the two places it's defined. There's a perf counter that does not use this variable so the comment above with TryLock does make sense wrt to that perf counter. This local variable is unused.

@jdksjolen jdksjolen changed the title 8332610: Remove confusing comment in ObjectMonitor::ReenterI 8332610 May 21, 2024
@jdksjolen
Copy link
Contributor Author

Please remove that unused variable also in the two places it's defined. There's a perf counter that does not use this variable so the comment above with TryLock does make sense wrt to that perf counter. This local variable is unused.

nWakeups deleted!

@openjdk openjdk bot changed the title 8332610 8332610: Remove unused nWakeups ObjectMonitor::ReenterI May 21, 2024
@jdksjolen jdksjolen changed the title 8332610: Remove unused nWakeups ObjectMonitor::ReenterI 8332610 May 21, 2024
@openjdk openjdk bot changed the title 8332610 8332610: Remove unused nWakeups ObjectMonitor May 21, 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.

Looks great! Thank you for finding this unused code.

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

@dcubed-ojdk dcubed-ojdk left a comment

Choose a reason for hiding this comment

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

Thumbs up. This is a trivial fix.

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Interestingly this code has been dead since it was introduced. I will assume it was leftover debugging/performance-monitoring code.

Comment on lines -1014 to -1017
// Keep a tally of the # of futile wakeups.
// Note that the counter is not protected by a lock or updated by atomics.
// That is by design - we trade "lossy" counters which are exposed to
// races during updates for a lower probe effect.
Copy link
Member

Choose a reason for hiding this comment

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

The same comment block needs deleting at line 874 too.

Copy link
Member

Choose a reason for hiding this comment

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

Actually, I think the comment blocks are referring to the OM_PERFDATA_OP(FutileWakeups, inc()); calls not the nWakeups local variable.

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Please restore comment, and possibly move them closer to the code the relate to.

Also nit: please change the bug synopsis to "Remove unused nWakeups in ObjectMonitor"

Thanks

@jdksjolen jdksjolen changed the title 8332610: Remove unused nWakeups ObjectMonitor 8332610: Remove unused nWakeups in ObjectMonitor May 22, 2024
@jdksjolen
Copy link
Contributor Author

Please restore comment, and possibly move them closer to the code the relate to.

Also nit: please change the bug synopsis to "Remove unused nWakeups in ObjectMonitor"

Thanks

Good catch on both! I've fixed the issues, thanks.

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.

I would not have missed that comment, but it looks fine.

@jdksjolen
Copy link
Contributor Author

Errors for maxos-x64 unrelated to this patch. Thanks Coleen, Dan and David.

/integrate

@openjdk
Copy link

openjdk bot commented May 22, 2024

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

  • 92d3350: 8331920: ubsan: g1CardSetContainers.inline.hpp:266:5: runtime error: index 2 out of bounds for type 'G1CardSetHowl::ContainerPtr [2]' reported
  • 4f1a10f: 8332360: JVM hangs at exit when running on a uniprocessor
  • c3bc23f: 8326306: RISC-V: Re-structure MASM calls and jumps
  • 8a9d77d: 8320622: [TEST] Improve coverage of compiler/loopopts/superword/TestMulAddS2I.java on different platforms
  • 3d511ff: 8329748: Change default value of AssertWXAtThreadSync to true
  • 67f03f2: 8332533: RISC-V: Enable vector variable shift instructions for machines with RVV
  • 5f804b2: 8329825: Clarify the value type for java.net.SocketOptions.SO_LINGER
  • 52eda79: 8332538: Switch off JIT memory limit check for TestAlignVectorFuzzer.java
  • d999b81: 8331572: Allow using OopMapCache outside of STW GC phases
  • 8291c94: 8331224: ClassCastException in ObjectInputStream hides ClassNotFoundException
  • ... and 20 more: https://git.openjdk.org/jdk/compare/b92bd671835c37cff58e2cdcecd0fe4277557d7f...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented May 22, 2024

@jdksjolen Pushed as commit 9ca90cc.

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

Copy link
Member

@dcubed-ojdk dcubed-ojdk left a comment

Choose a reason for hiding this comment

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

I'm fine with the final version also.

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
Development

Successfully merging this pull request may close these issues.

4 participants