8382306: Remove JvmtiTagMap::check_hashmap#30757
8382306: Remove JvmtiTagMap::check_hashmap#30757lmesnik wants to merge 1 commit intoopenjdk:masterfrom
Conversation
|
👋 Welcome back lmesnik! A progress list of the required criteria for merging this PR into |
|
@lmesnik 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 37 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 |
| tag_map->check_hashmap(objects); | ||
| tag_map->remove_dead_entries_locked(objects); |
There was a problem hiding this comment.
Seems the new code no longer skips processing in the is_empty() case - IIUC that will just be an extra clearing of weak refs if anything.
There was a problem hiding this comment.
I don't think it is important here. The check_hashmaps_for_heapwalk is called once during heapwalking operation which is extremely slow already.
There was a problem hiding this comment.
The another difference observed by @sspitsyn while discussing this issue.
The remove_dead_entries_locked() is now called and work even if
env()->is_enabled(JVMTI_EVENT_OBJECT_FREE)
is false.
It just cleans up tagmap table, but doesn't post events. Shouldn't change behaviour observed by jvmti agent.
The performance impact is not significant comparing with heap walking.
There was a problem hiding this comment.
One more difference that the check_hashmaps_for_heapwalk() is also called when objects == nullptr.
There was a problem hiding this comment.
check_hashmaps_for_heapwalk()
never called with objects == nullptr
The goal of this function is to post ObjectFree events.
I still wonder why is it needed? It collect tags for dead objects before heap walking and post them right after
corresponding VMOp is completed.
It is really unclear for me if there are any reasons to do this.
|
The total number of required reviews for this PR has been set to 2 based on the presence of this label: |
|
|
sspitsyn
left a comment
There was a problem hiding this comment.
I'm okay with this fix in general. But this code has a history to be fragile. What tests did you run for this?
coleenp
left a comment
There was a problem hiding this comment.
This does seem unnecessary when called with nullptr certainly. It appears that remove_dead_entries_locked also checks if needs_cleanup and if ObjectFree events should be posted. Looks like a nice cleanup.
As Serguei says, this code has been very fragile but the jvmti/jdi tests should verify if this is okay. Also run with ZGC stress options like -XX:ZCollectionInterval=1 or 0.1 I think.
|
Just chiming in: you can run a lot of frequent major GCs with ZGC using: |
|
Thank you for review and testing suggestions. |
|
Going to push as commit 0993467.
Your commit was automatically rebased without conflicts. |
The check_hashmap(nullptr) doesn't do anything now.
It was used to rehash map but now just returns.
And the remaining usage can be replaced with direct call of remove_dead_entries_locked.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/30757/head:pull/30757$ git checkout pull/30757Update a local copy of the PR:
$ git checkout pull/30757$ git pull https://git.openjdk.org/jdk.git pull/30757/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 30757View PR using the GUI difftool:
$ git pr show -t 30757Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/30757.diff
Using Webrev
Link to Webrev Comment