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
8274004: Change 'nonleaf' rank name #5845
Conversation
8273956: Add checking for rank values
👋 Welcome back coleenp! A progress list of the required criteria for merging this PR into |
@coleenp The following labels will be automatically applied to this pull request:
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. |
Webrevs
|
The PR description mentions: |
Mailing list message from coleen.phillimore at oracle.com on hotspot-dev: On 10/6/21 7:45 PM, Daniel D.Daugherty wrote:
It's actually both.? But I should close the 8273956 as a duplicate of |
Just do
and this PR will cover both. |
@dcubed-ojdk Only the author (@coleenp) is allowed to issue the |
@dcubed-ojdk Only the author (@coleenp) is allowed to issue the |
/issue JDK-8274004 Thank you @dcubed-ojdk! |
@coleenp This issue is referenced in the PR title - it will now be updated. |
@coleenp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Coleen,
Overall this looks good! But shouldn't the test:
test/hotspot/gtest/runtime/test_safepoint_locks.cpp
be replaced by one that checks we lock with/without a safepoint check for a safepoint/nonsafepoint lock respectively? (Or does that test already exist elsewhere?).
Also should there not be a gtest to verify your Rank overlap checking?
Thanks,
David
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks,
Patricio
Thanks for the review @pchilano and offline discussion about check_for_overlap. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Coleen,
A couple of comments on tests, but otherwise okay.
Thanks,
David
monitor_rank_broken->lock_without_safepoint_check(); | ||
monitor_rank_broken->unlock(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is dead code right - the assertion failure will stop us getting here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is dead code. I'll remove it and retest to make sure nothing surprising happens.
monitor_rank_broken->lock_without_safepoint_check(); | ||
monitor_rank_broken->unlock(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto - dead code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
JavaThread* THREAD = JavaThread::current(); | ||
ThreadInVMfromNative invm(THREAD); | ||
|
||
Monitor* monitor_rank_broken = new Monitor(Mutex::safepoint-1, "monitor_rank_broken"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rank is not actually broken is it - otherwise we won't get to the next line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right. It's not broken. I'll rename it to 'monitor_rank_ok'.
monitor_rank_also_broken->lock_without_safepoint_check(); | ||
monitor_rank_also_broken->unlock(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
@coleenp 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:
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 23 new commits pushed to the
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the dead test code and retested.
monitor_rank_broken->lock_without_safepoint_check(); | ||
monitor_rank_broken->unlock(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is dead code. I'll remove it and retest to make sure nothing surprising happens.
monitor_rank_broken->lock_without_safepoint_check(); | ||
monitor_rank_broken->unlock(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
JavaThread* THREAD = JavaThread::current(); | ||
ThreadInVMfromNative invm(THREAD); | ||
|
||
Monitor* monitor_rank_broken = new Monitor(Mutex::safepoint-1, "monitor_rank_broken"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right. It's not broken. I'll rename it to 'monitor_rank_ok'.
monitor_rank_also_broken->lock_without_safepoint_check(); | ||
monitor_rank_also_broken->unlock(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
Thanks for the code review David, and all the discussions leading to this change. |
/integrate |
Going to push as commit 6364719.
Your commit was automatically rebased without conflicts. |
Also fixes: 8273956: Add checking for rank values
This change does 3 things. I could separate them but this has all been tested together and most of the change is mechanical. The first is a simple rename of nonleaf => safepoint. The second change is to add the enum class Rank which only allows subtraction from a base rank, and some additional type checking so that rank arithmetic doesn't overlap with a different rank. Ie if you say nosafepoint-n, that doesn't overlap with oopstorage. The third change is to remove the _safepoint_check_always/never flag. That is now intrinsic in the ranking, as all nosafepoint ranks are lower than all safepoint ranks.
Future changes could add rank names in the middle of nosafepoint and safepoint, like handshake. As of now, the rank subtractions are not unmanageable. There are actually not many nested Mutex.
This is the last of the planned subtasks for Mutex ranking cleanup. If you have other ideas or suggestions, please let me know.
Tested with tier1-8 at one point in time and just retested with tier1-6.
Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5845/head:pull/5845
$ git checkout pull/5845
Update a local copy of the PR:
$ git checkout pull/5845
$ git pull https://git.openjdk.java.net/jdk pull/5845/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 5845
View PR using the GUI difftool:
$ git pr show -t 5845
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5845.diff