-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8329764: G1: Handle null references during verification first #18650
8329764: G1: Handle null references during verification first #18650
Conversation
👋 Welcome back tschatzl! A progress list of the required criteria for merging this PR into |
@tschatzl 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 66 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 |
Fwiw, removing the |
The parent pull request that this pull request depends on has now been integrated and the target branch of this pull request has been updated. This means that changes from the dependent pull request can start to show up as belonging to this pull request, which may be confusing for reviewers. To remedy this situation, simply merge the latest changes from the new target branch into this pull request by running commands similar to these in the local repository for your personal fork: git checkout submit/8329764-verification-null-refs-first
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# if there are conflicts, follow the instructions given by git merge
git commit -m "Merge master"
git push |
I integrated the simplest version of #18595 now. I still think it would be nice to clean away the assert(_containing_obj...) with my proposed changes. Should I do that? Or do you have some other plan for it? |
I am good with moving the The other changes from you about extracting the failure counter could be done as well - when refactoring this verification code the last time the extra 30 LOC or so did not seem worth to me, but the code is already fairly large. There are no further plans from me to improve verification performance further, apart from maybe filing a CR to parallelize verification of large object arrays. Does that answer your questions? |
I had hoped for a more clear yes or no. :) |
If unsure: Please move the assert and add the failure counter changes :) Would be nice to have. Thomas |
I've opened #18677 for the null-check and failure counting. |
Still saving ~200ms (release build) verifying that large array. |
500ms on a fastdebug build. |
From #18595 Stopping field-iteration at the specified limit sounds much nicer; can that be done instead of (or in addition to) this reordering? |
I am not completely sure what the exact goal of stopping field-iteration at specified limit is, however I think both options are orthonal: this change speeds up the common case (no error, null references), while the other would presumably make the VM exit faster in the failure case and/or guarantees to write only a particular amount of failure messages? Just brainstorming:
In any case these two efforts seem to be completely independent. As mentioned initially, I am okay to just close this PR, but it seems low hanging fruit obtained with little effort. |
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 to me.
That's true, but the new logic is kind of surprising -- the threshold is checked after we de-ref the field; I would have expected the threshold controls the field-iteration/de-ref.
I've noticed that the current iteration API lacks support for early returns... In the optimal scenario:
Since threshold is only accessed during failure cases, the impact on performance should be minimal. (This implementation relies on a new iteration API, and there may be overlooked details necessary for its proper functionality. Feel free to merge the current PR.) |
That is why I consider this change "ugly" as well. Looking at perf counters, my hunch is that the two loads for the current failure counter and the bound (and comparison) are just much more expensive (in terms of cpu resources even if both branches are easily predicted) than the single pointer deref and check against |
Going to push as commit a3fecdb.
Your commit was automatically rebased without conflicts. |
Hi all,
please review this change that suggests to move the null reference check in object iteration during heap verification first.
The reason is as stated, since null references are fairly common (not only in that test mentioned in https://bugs.openjdk.org/browse/JDK-8329314), it may make sense to put it first. Also, null references never fail anyway (and verification failure is supposed to be uncommon).
Improves total runtime of that test case from 3s (~3.9s cpu time) to 2.2s (~3.1s cpu time).
If you think it makes the code too ugly, I will retract it.
Testing: gha, local testing.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/18650/head:pull/18650
$ git checkout pull/18650
Update a local copy of the PR:
$ git checkout pull/18650
$ git pull https://git.openjdk.org/jdk.git pull/18650/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 18650
View PR using the GUI difftool:
$ git pr show -t 18650
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/18650.diff
Webrev
Link to Webrev Comment