Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

fisk
Copy link
Contributor

@fisk fisk commented Aug 10, 2022

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

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8292194: G1 nmethod entry barrier disarm value wraps around too early

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

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 10, 2022

👋 Welcome back eosterlund! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Aug 10, 2022
@openjdk
Copy link

openjdk bot commented Aug 10, 2022

@fisk The following label will be automatically applied to this pull request:

  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Aug 10, 2022
@mlbridge
Copy link

mlbridge bot commented Aug 10, 2022

Webrevs

Copy link
Member

@albertnetymk albertnetymk left a 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.

@openjdk
Copy link

openjdk bot commented Aug 15, 2022

@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:

8292194: G1 nmethod entry barrier disarm value wraps around too early

Reviewed-by: ayang, tschatzl

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 master branch:

  • 0813a47: 8282729: Serial: Move BOT implementation to collector specific directory
  • fa5cc4c: 8291878: NMT: Malloc limits
  • ad2e0c4: 8292778: EncodingSupport_md.c convertUtf8ToPlatformString wrong placing of free
  • 13c0369: 8242181: [Linux] Show source information when printing native stack traces in hs_err files
  • fe0544f: 8292790: Remove hashtable.hpp from other files
  • 926380d: 8292640: C2: Remove unused scratch register usages on x86
  • f3be673: 8292638: x86: Improve scratch register handling in VM stubs
  • d24b7b7: 8276651: java/lang/ProcessHandle tests fail with "RuntimeException: Input/output error" in java.lang.ProcessHandleImpl$Info.info0
  • 8a45abd: 8292654: G1 remembered set memory footprint regression after JDK-8286115
  • cc28783: 8292777: Remove hashtable.hpp from dependencies.hpp
  • ... and 195 more: https://git.openjdk.org/jdk/compare/88c96dd3eb28a273305d07fb2b0a36122484189c...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Aug 15, 2022
@fisk
Copy link
Contributor Author

fisk commented Aug 15, 2022

Thanks for the review, @albertnetymk!

@fisk
Copy link
Contributor Author

fisk commented Aug 24, 2022

Any more takers?

Comment on lines +111 to +113
// 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.
Copy link
Contributor

@tschatzl tschatzl Aug 24, 2022

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.

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤣
Just mentioning. Lgtm.

Copy link
Contributor Author

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.

@fisk
Copy link
Contributor Author

fisk commented Aug 24, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Aug 24, 2022

Going to push as commit a45a4b9.
Since your change was applied there have been 207 commits pushed to the master branch:

  • d3fed12: 8292864: Remove resourceHash.hpp from header files
  • b653b9c: 8291969: Convert LoaderConstraintsTable to ResourceHashtable
  • 0813a47: 8282729: Serial: Move BOT implementation to collector specific directory
  • fa5cc4c: 8291878: NMT: Malloc limits
  • ad2e0c4: 8292778: EncodingSupport_md.c convertUtf8ToPlatformString wrong placing of free
  • 13c0369: 8242181: [Linux] Show source information when printing native stack traces in hs_err files
  • fe0544f: 8292790: Remove hashtable.hpp from other files
  • 926380d: 8292640: C2: Remove unused scratch register usages on x86
  • f3be673: 8292638: x86: Improve scratch register handling in VM stubs
  • d24b7b7: 8276651: java/lang/ProcessHandle tests fail with "RuntimeException: Input/output error" in java.lang.ProcessHandleImpl$Info.info0
  • ... and 197 more: https://git.openjdk.org/jdk/compare/88c96dd3eb28a273305d07fb2b0a36122484189c...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Aug 24, 2022
@openjdk openjdk bot closed this Aug 24, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Aug 24, 2022
@openjdk
Copy link

openjdk bot commented Aug 24, 2022

@fisk Pushed as commit a45a4b9.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
3 participants