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

8315503: G1: Code root scan causes long GC pauses due to imbalanced iteration #476

Closed
wants to merge 4 commits into from

Conversation

GoeLin
Copy link
Member

@GoeLin GoeLin commented Apr 8, 2024

I backport this for parity with 21.0.4-oracle.

I had to resolve 3 files:

src/hotspot/share/gc/g1/heapRegion.cpp
Hunk #1 had to be resolved. "8140326: G1: Consider putting regions where evacuation failed into next collection set" is not in 21.
It adds the "keep_tracked" argument.

src/hotspot/share/gc/g1/heapRegionRemSet.cpp
Resolved hunk #2 because of "8140326: G1: Consider putting regions where evacuation failed into next collection set".
Resolved hunk #4 because "8313202: MutexLocker should disallow null Mutexes" is not in 21
(other Mutex class).

src/hotspot/share/gc/g1/heapRegionRemSet.cpp
Resulved hunk #2, dual to hunk #2 in .cpp file.

Resolved hunks are in a commit of their own.

I include the two direct follow ups
8317440: Lock rank checking fails when code root set is modified with the Servicelock held after JDK-8315503
8318720: G1: Memory leak in G1CodeRootSet after JDK-8315503

Both apply clean on top.

I'll backport the third follow-up
8323685: PrintSystemDictionaryAtExit has mutex rank assert
as dependend backport on top of these. It also applies clean,
but I think it is too large to merge it in here. See #477


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • JDK-8318720 needs maintainer approval
  • JDK-8317440 needs maintainer approval
  • JDK-8315503 needs maintainer approval
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issues

  • JDK-8315503: G1: Code root scan causes long GC pauses due to imbalanced iteration (Enhancement - P4 - Approved)
  • JDK-8317440: Lock rank checking fails when code root set is modified with the Servicelock held after JDK-8315503 (Bug - P2 - Approved)
  • JDK-8318720: G1: Memory leak in G1CodeRootSet after JDK-8315503 (Bug - P3 - Approved)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk21u-dev.git pull/476/head:pull/476
$ git checkout pull/476

Update a local copy of the PR:
$ git checkout pull/476
$ git pull https://git.openjdk.org/jdk21u-dev.git pull/476/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 476

View PR using the GUI difftool:
$ git pr show -t 476

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk21u-dev/pull/476.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 8, 2024

👋 Welcome back goetz! 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
Copy link

openjdk bot commented Apr 8, 2024

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

8315503: G1: Code root scan causes long GC pauses due to imbalanced iteration
8317440: Lock rank checking fails when code root set is modified with the Servicelock held after JDK-8315503
8318720: G1: Memory leak in G1CodeRootSet after JDK-8315503

Reviewed-by: sgehwolf, shade

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 36 new commits pushed to the master branch:

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 changed the title Backport 795e5dcc856491031b87a1f2a942681a582673ab 8315503: G1: Code root scan causes long GC pauses due to imbalanced iteration Apr 8, 2024
@openjdk
Copy link

openjdk bot commented Apr 8, 2024

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport rfr Pull request is ready for review labels Apr 8, 2024
@mlbridge
Copy link

mlbridge bot commented Apr 8, 2024

Webrevs

@jerboaa
Copy link
Contributor

jerboaa commented Apr 9, 2024

@GoeLin Please use /issue add for the bugs included in this backport.

@jerboaa
Copy link
Contributor

jerboaa commented Apr 9, 2024

/reviewers 2

@openjdk
Copy link

openjdk bot commented Apr 9, 2024

@jerboaa
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

Copy link
Contributor

@jerboaa jerboaa left a comment

Choose a reason for hiding this comment

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

Seems OK to me, but I'd like for somebody else to review it too. @shipilev or @tstuefe perhaps?

@shipilev
Copy link
Member

shipilev commented Apr 9, 2024

I looked at this change shortly after the initial integration into mainline, and thought it is quite a bit risky. I can look again, now with the history of related bugs. But I have to mention right now that it might still be risky.

@GoeLin
Copy link
Member Author

GoeLin commented Apr 9, 2024

That's what I thought, too, but it also seems to be quite an issue with 21.
We discussed this, and decided we want to have the whole set of changes addressing the class unloading issue in 21 following Oracle. To reduce the risk we ask for extra reviews :)
It will run through our testing tonight.

@jerboaa
Copy link
Contributor

jerboaa commented Apr 9, 2024

But I have to mention right now that it might still be risky.

@shipilev No doubt about that. For context: It's part of a larger change ported to Oracle JDK 21.0.4 to fix a class unloading perf regression. See https://bugs.openjdk.org/browse/JDK-8326092 and linked issues.

@tstuefe
Copy link
Member

tstuefe commented Apr 9, 2024

My fear when looking at the patch sequence was that Oracle probably did not test Shenandoah very thoroughly. I also did not particularly like the CLDG changes. And the patches have not had a lot of time to cook in mainline.

@GoeLin
Copy link
Member Author

GoeLin commented Apr 10, 2024

/issue 8317440

@openjdk
Copy link

openjdk bot commented Apr 10, 2024

@GoeLin
Adding additional issue to issue list: 8317440: Lock rank checking fails when code root set is modified with the Servicelock held after JDK-8315503.

@GoeLin
Copy link
Member Author

GoeLin commented Apr 10, 2024

/issue 8318720

@openjdk
Copy link

openjdk bot commented Apr 10, 2024

@GoeLin
Adding additional issue to issue list: 8318720: G1: Memory leak in G1CodeRootSet after JDK-8315503.

@GoeLin
Copy link
Member Author

GoeLin commented Apr 10, 2024

I don't think this change is a risk for Shenandoah, The shared changes are minimal.
Also, as 22 is released including this change and with all the testing it needed to undergo, and next LTS is only 25 in 1.5 years, I don't think the test coverage will get substantial better.

@GoeLin
Copy link
Member Author

GoeLin commented Apr 11, 2024

Ok, so now I got some risk assessments. But could I also please get reviews? I.e., is the backport as correct wrt 21 as it is in 22? I could as well ask someone else for a second review?

Copy link
Member

@shipilev shipilev left a comment

Choose a reason for hiding this comment

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

All right, this is not very scary, just the normal amount of scary.

@openjdk
Copy link

openjdk bot commented Apr 17, 2024

⚠️ @GoeLin This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@shipilev
Copy link
Member

Actually, let's ask @tschatzl directly if he knows about any other dependencies that might break this patch in JDK 21, or some other caveats.

@GoeLin
Copy link
Member Author

GoeLin commented Apr 18, 2024

Hi @shipilev, I would assume Thomas checked this when he backported it, so that we see all follow ups anyways!

@openjdk openjdk bot added approval ready Pull request is ready to be integrated and removed approval labels Apr 18, 2024
@GoeLin
Copy link
Member Author

GoeLin commented Apr 19, 2024

/integrate

@tschatzl
Copy link

tschatzl commented Apr 19, 2024

Hi @shipilev, I would assume Thomas checked this when he backported it, so that we see all follow ups anyways!

All known to me follow-ups were backported. All of them are referenced in the main backport JDK-8326092

@openjdk
Copy link

openjdk bot commented Apr 19, 2024

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

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Apr 19, 2024

@GoeLin Pushed as commit e63addb.

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

@shipilev
Copy link
Member

All known to me follow-ups were backported. All of them are referenced in the main backport JDK-8326092

Excellent, this is good to now. I see some related things that are only in 21.0.4-oracle. I assume @GoeLin is handling those :)

@GoeLin GoeLin deleted the goetz_backport_8315503 branch April 19, 2024 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport integrated Pull request has been integrated
5 participants