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

8328075: Shenandoah: Avoid forwarding when objects don't move in full-GC #18280

Closed
wants to merge 2 commits into from

Conversation

rkennke
Copy link
Contributor

@rkennke rkennke commented Mar 13, 2024

Currently, in Shenandoah's full-GC, we forward all marked objects (and preserve their headers), even if they don't move. This typically happens for a certain amount of 'sediment' that accumulates at the bottom of the heap. This results in wasted CPU cycles and memory accesses and usage. It can easily be avoided by not forwarding objects that don't move.

The fix is to simply not forward objects when they don't move.

Testing:

  • hotspot_gc_shenandoah
  • tier1 +UseShenandoahGC

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-8328075: Shenandoah: Avoid forwarding when objects don't move in full-GC (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 18280

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 13, 2024

👋 Welcome back rkennke! 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 Mar 13, 2024

@rkennke 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.

@openjdk openjdk bot added hotspot-gc hotspot-gc-dev@openjdk.org shenandoah shenandoah-dev@openjdk.org labels Mar 13, 2024
@openjdk
Copy link

openjdk bot commented Mar 13, 2024

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

8328075: Shenandoah: Avoid forwarding when objects don't move in full-GC

Reviewed-by: wkemper, shade, kdnilsen, ysr

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

  • e8d1ba3: 8328228: Missing comma in copyright year for a few JColorChooser tests
  • be1dd27: 8328130: Remove applet usage from JColorChooser tests Test4759934
  • fab0edc: 8328121: Remove applet usage from JColorChooser tests Test4759306
  • 7c6fd33: 8327857: Remove applet usage from JColorChooser tests Test4222508
  • 89fb0f8: 8327859: Remove applet usage from JColorChooser tests Test4319113
  • df909e2: 8328011: Convert java/awt/Frame/GetBoundsResizeTest/GetBoundsResizeTest.java applet test to main
  • 87bd6ca: 8328021: Convert applet test java/awt/List/SetFontTest/SetFontTest.html to main program
  • 2482a50: 8326898: NSK tests should listen on loopback addresses only
  • e6a8fdd: 8328135: javax/management/remote/mandatory/loading/MissingClassTest.java fails on libgraal
  • 7cc1965: 8328124: Convert java/awt/Frame/ShownOnPack/ShownOnPack.html applet test to main
  • ... and 44 more: https://git.openjdk.org/jdk/compare/a4a5196351a3c8ce45e2e36d27842194cbfcc5ff...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.

@rkennke rkennke changed the title 8328107: Shenandoah/C2: TestVerifyLoopOptimizations test failure 8328075: Shenandoah: Avoid forwarding when objects don't move in full-GC Mar 14, 2024
@rkennke rkennke marked this pull request as ready for review March 14, 2024 08:20
@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 14, 2024
@mlbridge
Copy link

mlbridge bot commented Mar 14, 2024

Webrevs

Copy link
Contributor

@earthling-amzn earthling-amzn left a comment

Choose a reason for hiding this comment

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

LGTM

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.

A few nits. I think we do the same thing for humongous objects already (where it is really painful), no particular reason not to do the same for regular ones. Any performance tests for Full GC improve?

src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp Outdated Show resolved Hide resolved
src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp Outdated Show resolved Hide resolved
@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 14, 2024
Copy link
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.

Looks good after Aleksey's assertion comment fix. (FWIW, i've seen many back-to-back Full GCs that do not relocate any objects on some of the jtreg tests. Of course, these back-to-back Full GCs hopefully don't represent typical behavior of real workloads.)

@rkennke
Copy link
Contributor Author

rkennke commented Mar 15, 2024

Thanks!
/integrate

@openjdk
Copy link

openjdk bot commented Mar 15, 2024

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

  • 5249cc0: 8328087: Automate javax/swing/JTable/TAB/TAB.java applet test
  • c05f8c7: 8316388: Opensource five Swing component related regression tests
  • b8dfeaf: 8328158: Convert java/awt/Choice/NonFocusablePopupMenuTest to automatic main test
  • d57bdd8: 8328165: improve assert(idx < _maxlrg) failed: oob
  • 128e60a: 8328037: Test java/util/Formatter/Padding.java has unnecessary high heap requirement after JDK-8326718
  • 06f4b7f: 8327756: Convert javax/swing/JSlider/4987336/bug4987336.java applet to main
  • 605800e: 8203867: Delete test java/awt/TrayIcon/DblClickActionEventTest/DblClickActionEventTest.html
  • 0943937: 8328218: Delete test java/awt/Window/FindOwner/FindOwner.html
  • f6390e5: 8328089: Automate javax/swing/JTable/4222153/bug4222153.java applet test
  • e8d1ba3: 8328228: Missing comma in copyright year for a few JColorChooser tests
  • ... and 53 more: https://git.openjdk.org/jdk/compare/a4a5196351a3c8ce45e2e36d27842194cbfcc5ff...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Mar 15, 2024

@rkennke Pushed as commit 80ccc98.

💡 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
5 participants