Skip to content

8390907: Genshen: Improve mark loop performance - #32488

Closed
earthling-amzn wants to merge 27 commits into
openjdk:masterfrom
earthling-amzn:simplify-reremember-during-mark
Closed

8390907: Genshen: Improve mark loop performance#32488
earthling-amzn wants to merge 27 commits into
openjdk:masterfrom
earthling-amzn:simplify-reremember-during-mark

Conversation

@earthling-amzn

@earthling-amzn earthling-amzn commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

There are several small changes here that add up to a 10% to 12% reduction in mark times on specjbb2015.

  • Gate the re-remembering work on a template parameter so that only the remembered set scan closure needs to do it
  • Bias the affiliation byte array to eliminate a subtraction for every oop
  • Loosen the check on heap inclusion for decoded oops
  • Inline the card marking function
  • Inline age census add function
  • Test for two pointers being in the same region before testing if old points to young


Progress

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

Issue

  • JDK-8390907: Genshen: Improve mark loop performance (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 32488

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@earthling-amzn
earthling-amzn marked this pull request as draft August 21, 2026 22:11
@bridgekeeper

bridgekeeper Bot commented Aug 21, 2026

Copy link
Copy Markdown

👋 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

openjdk Bot commented Aug 21, 2026

Copy link
Copy Markdown

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

8390907: Genshen: Improve mark loop performance

Reviewed-by: kdnilsen, shade

You can use pull request commands such as /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 20 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 Aug 21, 2026
@openjdk

openjdk Bot commented Aug 21, 2026

Copy link
Copy Markdown

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

@openjdk

openjdk Bot commented Aug 21, 2026

Copy link
Copy Markdown

The total number of required reviews for this PR has been set to 2 based on the presence of this label: hotspot-gc. This can be overridden with the /reviewers command.

Comment thread src/hotspot/share/gc/shenandoah/shenandoahMark.inline.hpp Outdated
inline bool is_write_card_dirty(HeapWord* p) const;
inline void mark_card_as_dirty(HeapWord* p);

void mark_card_as_dirty(HeapWord* p) const {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Functions like these really belong in .inline.hpp. Putting anything non-trivial in the .hpp risks circular dependencies that are hard to untangle.

Comment thread src/hotspot/share/gc/shenandoah/shenandoahMark.hpp Outdated
@openjdk

openjdk Bot commented Aug 24, 2026

Copy link
Copy Markdown

@earthling-amzn this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout simplify-reremember-during-mark
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk Bot added the merge-conflict Pull request has merge conflict with target branch label Aug 24, 2026
@shipilev

Copy link
Copy Markdown
Member

In my runs, I also see ShenandoahAgeCensus::add not inlined. Have you seen it in yours?

@openjdk openjdk Bot removed the merge-conflict Pull request has merge conflict with target branch label Aug 24, 2026
Comment thread src/hotspot/share/gc/shenandoah/shenandoahScanRemembered.inline.hpp
@earthling-amzn
earthling-amzn marked this pull request as ready for review August 25, 2026 21:53
@openjdk openjdk Bot added the rfr Pull request is ready for review label Aug 25, 2026
@mlbridge

mlbridge Bot commented Aug 25, 2026

Copy link
Copy Markdown

Webrevs

@kdnilsen kdnilsen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks. Nice performance improvements.

@shipilev shipilev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks all right with a few nits.

* Copyright (c) 2015, 2020, Red Hat, Inc. All rights reserved.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
* Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This moves dates backwards, so it does not look right.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry, bad merge.

Comment on lines +389 to +391
if (ShenandoahHeapRegion::is_in_same_region(maybe_old, maybe_young)) {
return false;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just for my understanding. This is a narrower check than we can do? I would have tried to check that region affiliations are different. But that performs access to affiliation bitmap, so that's why we do this address-only check, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right, it's meant to be a cheap test that the pointers are in different regions to avoid looking up their respective affiliations.

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label Aug 26, 2026
@openjdk openjdk Bot removed the ready Pull request is ready to be integrated label Aug 26, 2026
@openjdk openjdk Bot added the ready Pull request is ready to be integrated label Aug 26, 2026
@earthling-amzn

Copy link
Copy Markdown
Contributor Author

Failures look like network timeouts or other infrastructure issues.

/integrate

@openjdk

openjdk Bot commented Aug 26, 2026

Copy link
Copy Markdown

Going to push as commit c86277f.
Since your change was applied there have been 22 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 Aug 26, 2026
@openjdk openjdk Bot closed this Aug 26, 2026
@openjdk openjdk Bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Aug 26, 2026
@openjdk

openjdk Bot commented Aug 26, 2026

Copy link
Copy Markdown

@earthling-amzn Pushed as commit c86277f.

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

3 participants