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
8292194: G1 nmethod entry barrier disarm value wraps around too early #9822
Conversation
👋 Welcome back eosterlund! A progress list of the required criteria for merging this PR into |
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. Though, it's unclear to me why the counter is signed in the first place.
@fisk 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 205 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 review, @albertnetymk! |
Any more takers? |
// aborted N times, that is when there could be ABA problems. If there are anything | ||
// close to INT_MAX - 1 GCs starting without being able to finish, something is | ||
// seriously wrong. |
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.
Unfortunately, "something is seriously wrong" is not true. I have seen benchmarks where G1 is stuck in Concurrent Undo cycles because the concurrent start gc always can always reclaim some humongous object that gets G1 below the concurrent marking threshold again. That can last for 100's of such occurrences.
Obviously idk if before INT_MAX such concurrent undo marks there will be at least one "full" marking cycle, but there does not seem to be a guarantee.
One solution is to force completion of a marking cycle after X (where X is a very high number) subsequent concurrent undos.
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.
Let's say a rather rapid back to back concurrent full GC interval might be 10 ms ish. With such time intervals, it would take a bit over 16 years worth of being constantly interrupted and not finishing a single GC cycle, before any assumption would be broken. I wouldn't wish for anyone to be stuck in a single JVM for that long, hence why I think "something is seriously wrong" if that ever happened. I'm personally okay with that, and think we have bigger fish to fry. For example, the CollectedHeap::_total_collections counter is an unsigned int and there assumptions that it never wraps around. That sounds more likely to ever happen. Yet seemingly unlikely.
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.
🤣
Just mentioning. Lgtm.
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.
Thanks for the review, @tschatzl.
/integrate |
Going to push as commit a45a4b9.
Your commit was automatically rebased without conflicts. |
The disarm value for G1 nmethod entry barriers assumes that a concurrent GC can be aborted at most once. However, it can happen many times. In order to avoid ABA issues in the nmethod entry barriers, the limit for wrapping around and reusing numbers needs to be higher. This patch changes that point to INT_MAX as there is little point in using lower values.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9822/head:pull/9822
$ git checkout pull/9822
Update a local copy of the PR:
$ git checkout pull/9822
$ git pull https://git.openjdk.org/jdk pull/9822/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 9822
View PR using the GUI difftool:
$ git pr show -t 9822
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9822.diff