-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8256072: Eliminate JVMTI tagmap rehashing #10938
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
Conversation
|
👋 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
|
|
/test |
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.
Looks good. Yay code deletion!
I was particularly happy to see set_needs_rehashing removed from all the GCs.
As a followup, I think CollectedHeap::hash_oop is unused after this change.
|
@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 16 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 |
|
Thanks for the code review Kim. I removed the function that you noticed is now unused. |
kimbarrett
left a comment
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.
Looks good. Maybe just a little more deletion.
|
|
||
| inline uint32_t ZHeap::hash_oop(uintptr_t addr) const { | ||
| const uintptr_t offset = ZAddress::offset(addr); | ||
| return ZHash::address_to_uint32(offset); |
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 think removal of the call to ZHash::address_to_uint32 means this file no longer needs to include zHash.inline.hpp.
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 think you are right Kim.
fisk
left a comment
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 love the use of identity hash code instead of address bits. There might be an issue with displaced markWords though where we need to be careful.
| } | ||
|
|
||
| JvmtiTagMapEntry* JvmtiTagMapTable::find(oop obj) { | ||
| if (obj->has_no_hash()) { |
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 new function you added checks if the markWord has a hashCode. If there is a displaced markWord, then it very well might be that there is a hashCode, but it is in the displaced markWord - either in a stack lock or an ObjectMonitor. Bailing here does not seem correct, as it might actually be in the table even if there is no hashCode in the markWord. Is this an optimization?
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.
It is an optimization. I don't think we want to create an identity hash for all oops just for lookup. Is there a better way to find if an oop hashCode?
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 was hoping there was just a bit but you're right. I renamed it to fast_no_hash_check() and only return true if the object is unlocked and added a comment.
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'm rerunning jvmti and jdi tests locally.
fisk
left a comment
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.
Looks good now to me!
|
Thanks Erik and Kim for reviewing! |
kimbarrett
left a comment
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.
Good thing Erik caught the displaced markword issue. Looks even better now.
src/hotspot/share/oops/oop.hpp
Outdated
|
|
||
| // identity hash; returns the identity hash key (computes it if necessary) | ||
| inline bool has_no_hash(); | ||
| inline bool fast_no_hash_check(); |
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.
Seems like fast_no_hash_check ought to be later in this grouping. The preceding comment is about identity_hash.
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.
Ok, this makes sense. Thanks.
|
Thanks for the re-review Kim. Recompiled with the trivial change. |
|
Going to push as commit 94eb25a.
Your commit was automatically rebased without conflicts. |
Use identity_hash for objects in the JVMTI TagMap table. If the object has no hashcode, it's not in the table.
Tested with tier1-6.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10938/head:pull/10938$ git checkout pull/10938Update a local copy of the PR:
$ git checkout pull/10938$ git pull https://git.openjdk.org/jdk pull/10938/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 10938View PR using the GUI difftool:
$ git pr show -t 10938Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10938.diff