Skip to content

8379367: GenShen: Replace atomic promotion failure counters with thread local variables#30101

Closed
earthling-amzn wants to merge 17 commits intoopenjdk:masterfrom
earthling-amzn:refactor-plabs-fixed
Closed

8379367: GenShen: Replace atomic promotion failure counters with thread local variables#30101
earthling-amzn wants to merge 17 commits intoopenjdk:masterfrom
earthling-amzn:refactor-plabs-fixed

Conversation

@earthling-amzn
Copy link
Copy Markdown
Contributor

@earthling-amzn earthling-amzn commented Mar 5, 2026

The atomic counters caused a serious performance regression for failed promotions.

Compare times for evacuations with promotions before this change:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------                                             
                                        |                   TARGET                    |              ACTUAL (Workers)               |                                                                                           
                                 GC Key |      YOUNG    PROMOTE        OLD      TOTAL |      YOUNG    PROMOTE        OLD      TOTAL |  Abandoned  Act Promo       Time  Workers                                                 
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------                                             
9/StripedPromotionBenchmark2.jvm.log:61 |   1298.0MB    922.0MB      0.0MB   2220.0MB |   1915.0MB    304.0MB      0.0MB   2219.0MB |      0.0MB    305.0MB   3844.1ms       24                                                 
7/StripedPromotionBenchmark2.jvm.log:47 |    806.0MB    867.0MB      0.0MB   1674.0MB |   1216.0MB    457.0MB      0.0MB   1673.0MB |      0.0MB    458.0MB   3895.3ms       24                                                 
2/StripedPromotionBenchmark2.jvm.log:53 |   1139.0MB    588.0MB      0.0MB   1727.0MB |   1269.0MB    457.0MB      0.0MB   1726.0MB |      0.0MB    458.0MB   3932.2ms       24                                                 
5/StripedPromotionBenchmark2.jvm.log:41 |    579.0MB    890.0MB      0.0MB   1469.0MB |   1317.0MB    151.0MB      0.0MB   1468.0MB |      0.0MB    152.0MB   4037.1ms       24                                                 
7/StripedPromotionBenchmark2.jvm.log:53 |    589.0MB    993.0MB      0.0MB   1583.0MB |   1316.0MB    266.0MB      0.0MB   1582.0MB |      0.0MB    267.0MB   4148.5ms       24                                                 
6/StripedPromotionBenchmark2.jvm.log:35 |   1529.0MB    612.0MB      0.0MB   2142.0MB |   1378.0MB    764.0MB      0.0MB   2142.0MB |      0.0MB    765.0MB   4299.2ms       24                                                 
9/StripedPromotionBenchmark2.jvm.log:49 |   1123.0MB   1131.0MB      0.0MB   2255.0MB |   2102.0MB    152.0MB      0.0MB   2254.0MB |      0.0MB    153.0MB   4308.6ms       24                                                 
2/StripedPromotionBenchmark2.jvm.log:33 |   1472.0MB      0.0MB      0.0MB   1472.0MB |   1466.0MB      6.2MB      0.0MB   1472.2MB |      0.0MB      6.0MB   4482.9ms       24                                                 
6/StripedPromotionBenchmark2.jvm.log:33 |   1623.0MB      0.0MB      0.0MB   1623.0MB |   1612.0MB     10.6MB      0.0MB   1622.6MB |      0.0MB     10.0MB   5001.7ms       24                                                 
6/StripedPromotionBenchmark2.jvm.log:47 |   1533.0MB    958.0MB      0.0MB   2492.0MB |   2055.0MB    436.0MB      0.0MB   2491.0MB |      0.0MB    437.0MB   6407.2ms       24 

with those times on the same benchmark after this change:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------                                             
                                        |                   TARGET                    |              ACTUAL (Workers)               |                                                                                           
                                 GC Key |      YOUNG    PROMOTE        OLD      TOTAL |      YOUNG    PROMOTE        OLD      TOTAL |  Abandoned  Act Promo       Time  Workers                                                 
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------                                             
1/StripedPromotionBenchmark2.jvm.log:57 |    854.0MB    609.0MB      0.0MB   1464.0MB |    320.0MB   1143.0MB      0.0MB   1463.0MB |      0.0MB      0.0MB    199.2ms       24                                                 
1/StripedPromotionBenchmark2.jvm.log:55 |    705.0MB    604.0MB      0.0MB   1309.0MB |    698.0MB    610.0MB      0.0MB   1308.0MB |      0.0MB    611.0MB    213.9ms       24                                                 
1/StripedPromotionBenchmark2.jvm.log:53 |   1113.0MB    381.0MB      0.0MB   1495.0MB |    745.0MB    749.0MB      0.0MB   1494.0MB |      0.0MB    750.0MB    221.0ms       24                                                 
1/StripedPromotionBenchmark2.jvm.log:63 |   1006.0MB    606.0MB      0.0MB   1612.0MB |   1192.0MB    419.0MB      0.0MB   1611.0MB |      0.0MB      0.0MB    229.0ms       24                                                 
1/StripedPromotionBenchmark2.jvm.log:41 |    922.0MB    921.0MB      0.0MB   1844.0MB |   1462.0MB    381.0MB      0.0MB   1843.0MB |      0.0MB      0.0MB    235.9ms       24                                                 
1/StripedPromotionBenchmark2.jvm.log:65 |    990.0MB    606.0MB      0.0MB   1597.0MB |    271.0MB   1325.0MB      0.0MB   1596.0MB |      0.0MB      0.0MB    243.6ms       24                                                 
1/StripedPromotionBenchmark2.jvm.log:45 |    994.0MB    922.0MB      0.0MB   1917.0MB |   1421.0MB    495.0MB      0.0MB   1916.0MB |      0.0MB      0.0MB    277.1ms       24                                                 
1/StripedPromotionBenchmark2.jvm.log:51 |   1105.0MB    858.0MB      0.0MB   1964.0MB |   1238.0MB    725.0MB      0.0MB   1963.0MB |      0.0MB    726.0MB    284.6ms       24                                                 
1/StripedPromotionBenchmark2.jvm.log:49 |   1313.0MB    795.0MB      0.0MB   2108.0MB |   1573.0MB    534.0MB      0.0MB   2107.0MB |      0.0MB      0.0MB    318.5ms       24                                                 
1/StripedPromotionBenchmark2.jvm.log:47 |   1257.0MB    858.0MB      0.0MB   2116.0MB |   1696.0MB    419.0MB      0.0MB   2115.0MB |      0.0MB      0.0MB    321.9ms       24

This change also combines the plab fields from ShenandoahThreadLocalData with the associated plab methods from ShenandoahGenerationalHeap into a more cohesive ShenandoahPLAB class.


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-8379367: GenShen: Replace atomic promotion failure counters with thread local variables (Enhancement - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/30101/head:pull/30101
$ git checkout pull/30101

Update a local copy of the PR:
$ git checkout pull/30101
$ git pull https://git.openjdk.org/jdk.git pull/30101/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 30101

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/30101.diff

Using Webrev

Link to Webrev Comment

@earthling-amzn earthling-amzn marked this pull request as draft March 5, 2026 23:26
@bridgekeeper
Copy link
Copy Markdown

bridgekeeper bot commented Mar 5, 2026

👋 Welcome back wkemper! 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
Copy Markdown

openjdk bot commented Mar 5, 2026

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

8379367: GenShen: Replace atomic promotion failure counters with thread local variables

Reviewed-by: kdnilsen

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 218 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 added hotspot-gc hotspot-gc-dev@openjdk.org shenandoah shenandoah-dev@openjdk.org labels Mar 5, 2026
@openjdk
Copy link
Copy Markdown

openjdk bot commented Mar 5, 2026

@earthling-amzn The following labels will be automatically applied to this pull request:

  • hotspot-gc
  • shenandoah

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

Copy link
Copy Markdown
Contributor

@kdnilsen kdnilsen left a comment

Choose a reason for hiding this comment

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

Thanks for getting to the bottom of this issue and resolving it so cleanly...

@earthling-amzn earthling-amzn marked this pull request as ready for review March 9, 2026 18:22
@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 9, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge bot commented Mar 9, 2026

Webrevs

Copy link
Copy Markdown
Contributor

@kdnilsen kdnilsen left a comment

Choose a reason for hiding this comment

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

Thanks again.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 20, 2026
@earthling-amzn
Copy link
Copy Markdown
Contributor Author

/integrate

@openjdk
Copy link
Copy Markdown

openjdk bot commented Mar 20, 2026

Going to push as commit 26c4b5f.
Since your change was applied there have been 218 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 Mar 20, 2026
@openjdk openjdk bot closed this Mar 20, 2026
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Mar 20, 2026
@openjdk
Copy link
Copy Markdown

openjdk bot commented Mar 20, 2026

@earthling-amzn Pushed as commit 26c4b5f.

💡 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-gc hotspot-gc-dev@openjdk.org integrated Pull request has been integrated shenandoah shenandoah-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

2 participants