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

8325754: Dead AbstractQueuedSynchronizer$ConditionNodes survive minor garbage collections #2599

Closed

Conversation

neethu-prasad
Copy link
Contributor

@neethu-prasad neethu-prasad commented Jun 17, 2024

Notes
Backport of JDK-8325754.

Unlink 'ConditionNode' before they are transferred to the sync queue as G1 seems to be able to collect “dead” ConditionNode instances during minor collections only if no formerly alive ConditionNode instances were promoted to the old generation and died there, which often cannot be avoided since e.g. on application startup many objects are promoted to the old generation after a few collections.

Verification

  • jdk_util, Tier 1 & Tier 2 tests passed.
  • Ran G1LoiteringConditionNodes.java (sample code from bug description) and verified that YG GC time is not increasing after full GC.

Before PR

dev-dsk-neethp-jdk-2c-ad54955c % /home/neethp/Development/jdk17u-dev/build/linux-x86_64-server-release/images/jdk/bin/java -Xms2048m -Xmx2048m -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:G1MaxNewSizePercent=20 '-Xlog:gc*,gc+age*=trace' -cp . G1LoiteringConditionNodes | grep -E 'Pause.*ms'
[0.960s][info ][gc          ] GC(0) Pause Young (Normal) (G1 Evacuation Pause) 102M->1M(2048M) 5.290ms
[2.485s][info ][gc          ] GC(1) Pause Young (Normal) (G1 Evacuation Pause) 149M->1M(2048M) 2.288ms
[6.805s][info ][gc          ] GC(2) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.393ms
[11.165s][info ][gc          ] GC(3) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.603ms
[15.544s][info ][gc          ] GC(4) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.462ms
[19.955s][info ][gc          ] GC(5) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.382ms
[24.369s][info ][gc          ] GC(6) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.246ms
[28.790s][info ][gc          ] GC(7) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.443ms
[33.211s][info ][gc          ] GC(8) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.331ms
[37.639s][info ][gc          ] GC(9) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.319ms
[42.066s][info ][gc          ] GC(10) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.629ms
[46.515s][info ][gc          ] GC(11) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.334ms
[50.957s][info ][gc          ] GC(12) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.280ms
[55.382s][info ][gc          ] GC(13) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.413ms
[59.830s][info ][gc          ] GC(14) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.061ms
[60.055s][info ][gc             ] GC(15) Pause Full (System.gc()) 26M->1M(2048M) 10.780ms
[64.482s][info ][gc             ] GC(16) Pause Young (Normal) (G1 Evacuation Pause) 410M->2M(2048M) 3.663ms
[68.893s][info ][gc             ] GC(17) Pause Young (Normal) (G1 Evacuation Pause) 410M->2M(2048M) 4.008ms
[73.297s][info ][gc             ] GC(18) Pause Young (Normal) (G1 Evacuation Pause) 409M->3M(2048M) 4.131ms
[77.699s][info ][gc             ] GC(19) Pause Young (Normal) (G1 Evacuation Pause) 410M->3M(2048M) 4.188ms
[82.106s][info ][gc             ] GC(20) Pause Young (Normal) (G1 Evacuation Pause) 410M->3M(2048M) 5.016ms
[86.509s][info ][gc             ] GC(21) Pause Young (Normal) (G1 Evacuation Pause) 409M->4M(2048M) 4.563ms
[90.907s][info ][gc             ] GC(22) Pause Young (Normal) (G1 Evacuation Pause) 410M->4M(2048M) 4.976ms
[95.292s][info ][gc             ] GC(23) Pause Young (Normal) (G1 Evacuation Pause) 409M->5M(2048M) 5.171ms
[99.671s][info ][gc             ] GC(24) Pause Young (Normal) (G1 Evacuation Pause) 410M->5M(2048M) 5.279ms
[104.050s][info ][gc             ] GC(25) Pause Young (Normal) (G1 Evacuation Pause) 410M->6M(2048M) 5.496ms
[108.418s][info ][gc             ] GC(26) Pause Young (Normal) (G1 Evacuation Pause) 410M->6M(2048M) 6.194ms
[112.784s][info ][gc             ] GC(27) Pause Young (Normal) (G1 Evacuation Pause) 410M->6M(2048M) 5.887ms
[117.147s][info ][gc             ] GC(28) Pause Young (Normal) (G1 Evacuation Pause) 409M->7M(2048M) 5.952ms
[121.505s][info ][gc             ] GC(29) Pause Young (Normal) (G1 Evacuation Pause) 410M->7M(2048M) 6.124ms
[125.846s][info ][gc             ] GC(30) Pause Young (Normal) (G1 Evacuation Pause) 409M->8M(2048M) 6.195ms
[130.192s][info ][gc             ] GC(31) Pause Young (Normal) (G1 Evacuation Pause) 410M->8M(2048M) 7.301ms

After this change

dev-dsk-neethp-jdk-2c-ad54955c % /home/neethp/Development/jdk17u-dev/build/linux-x86_64-server-release/images/jdk/bin/java -Xms2048m -Xmx2048m -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:G1MaxNewSizePercent=20 '-Xlog:gc*,gc+age*=trace' -cp . G1LoiteringConditionNodes | grep -E 'Pause.*ms'
[0.983s][info ][gc          ] GC(0) Pause Young (Normal) (G1 Evacuation Pause) 102M->1M(2048M) 4.400ms
[2.474s][info ][gc          ] GC(1) Pause Young (Normal) (G1 Evacuation Pause) 146M->1M(2048M) 2.198ms
[6.783s][info ][gc          ] GC(2) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.725ms
[11.169s][info ][gc          ] GC(3) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.613ms
[15.543s][info ][gc          ] GC(4) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.207ms
[19.941s][info ][gc          ] GC(5) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.155ms
[24.360s][info ][gc          ] GC(6) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 1.993ms
[28.789s][info ][gc          ] GC(7) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.168ms
[33.217s][info ][gc          ] GC(8) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.291ms
[37.644s][info ][gc          ] GC(9) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.463ms
[42.071s][info ][gc          ] GC(10) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.533ms
[46.514s][info ][gc          ] GC(11) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.097ms
[50.961s][info ][gc          ] GC(12) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.460ms
[55.381s][info ][gc          ] GC(13) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.409ms
[59.817s][info ][gc          ] GC(14) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.716ms
[60.082s][info ][gc             ] GC(15) Pause Full (System.gc()) 27M->1M(2048M) 9.750ms
[64.502s][info ][gc             ] GC(16) Pause Young (Normal) (G1 Evacuation Pause) 410M->1M(2048M) 1.855ms
[68.917s][info ][gc             ] GC(17) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.130ms
[73.325s][info ][gc             ] GC(18) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 1.897ms
[77.733s][info ][gc             ] GC(19) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 1.963ms
[82.135s][info ][gc             ] GC(20) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 1.986ms
[86.545s][info ][gc             ] GC(21) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.204ms
[90.946s][info ][gc             ] GC(22) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 1.737ms
[95.359s][info ][gc             ] GC(23) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 1.858ms
[99.757s][info ][gc             ] GC(24) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.115ms
[104.161s][info ][gc             ] GC(25) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 1.915ms

Progress

  • JDK-8325754 needs maintainer approval
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8325754: Dead AbstractQueuedSynchronizer$ConditionNodes survive minor garbage collections (Bug - P4 - Approved)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2599

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 17, 2024

👋 Welcome back neethu-prasad! 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 Jun 17, 2024

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

8325754: Dead AbstractQueuedSynchronizer$ConditionNodes survive minor garbage collections

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 121 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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot changed the title Backport 60cbf2925024b1c2253256688ae41741fff0a860 8325754: Dead AbstractQueuedSynchronizer$ConditionNodes survive minor garbage collections Jun 17, 2024
@openjdk
Copy link

openjdk bot commented Jun 17, 2024

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

@neethu-prasad neethu-prasad marked this pull request as ready for review June 18, 2024 13:59
@openjdk
Copy link

openjdk bot commented Jun 18, 2024

⚠️ @neethu-prasad 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.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 18, 2024
@mlbridge
Copy link

mlbridge bot commented Jun 18, 2024

Webrevs

@neethu-prasad
Copy link
Contributor Author

neethu-prasad commented Jun 18, 2024

/approval request Backport to unlink 'ConditionNode' before they are transferred to the sync queue; applies cleanly; All tests passed; Risk is low: there are no follow-up bug since mainline integration 4 months ago. Also, similar change was made to LinkedBlockingQueue more than 10 years ago as part of JDK-6805775

@openjdk
Copy link

openjdk bot commented Jun 18, 2024

@neethu-prasad
8325754: The approval request has been created successfully.

@openjdk openjdk bot added approval ready Pull request is ready to be integrated and removed approval labels Jun 18, 2024
@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jul 10, 2024
@openjdk
Copy link

openjdk bot commented Jul 10, 2024

@neethu-prasad
Your change (at version 3a947ac) is now ready to be sponsored by a Committer.

@neethu-prasad
Copy link
Contributor Author

Will integrate once backport to 21 is closed.
https://bugs.openjdk.org/browse/JDK-8334825

@phohensee
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Jul 11, 2024

Going to push as commit 4c58e1b.
Since your change was applied there have been 125 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 Jul 11, 2024
@openjdk openjdk bot closed this Jul 11, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Jul 11, 2024
@openjdk
Copy link

openjdk bot commented Jul 11, 2024

@phohensee @neethu-prasad Pushed as commit 4c58e1b.

💡 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
backport clean integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

2 participants