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

8275055: Improve HeapRegionRemSet::split_card() #5895

Closed

Conversation

tschatzl
Copy link
Contributor

@tschatzl tschatzl commented Oct 11, 2021

Hi all,

can I have reviews for this small change that improves HeapRegionRemSet::split_card() by reducing the number of (direct and indirect) memory accesses for it. It is hard to actually measure improvements because it's only called in concurrent code. So no particular improvements measured.

It also prepares that method for virtualizing the remembered set containers, allowing arbitrarily large heap region sizes JDK-8275056. This change is required then because the splitting of a card index into "region" and "card within region" should not be dependent on heap regions.

Testing: gha, gc/g1 local testing.

Thanks,
Thomas


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5895/head:pull/5895
$ git checkout pull/5895

Update a local copy of the PR:
$ git checkout pull/5895
$ git pull https://git.openjdk.java.net/jdk pull/5895/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5895

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5895.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 11, 2021

👋 Welcome back tschatzl! 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 Oct 11, 2021

@tschatzl The following label will be automatically applied to this pull request:

  • hotspot-gc

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

@openjdk openjdk bot added the hotspot-gc hotspot-gc-dev@openjdk.org label Oct 11, 2021
@tschatzl tschatzl marked this pull request as ready for review October 11, 2021 15:20
@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 11, 2021
@mlbridge
Copy link

mlbridge bot commented Oct 11, 2021

Webrevs

Copy link
Contributor

@kstefanj kstefanj 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, but I would like us to come up with better naming for the limit.

src/hotspot/share/gc/g1/heapRegionRemSet.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

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

@@ -177,6 +177,10 @@ class G1CardSetContainer {
void set_next(G1CardSetContainer* next) {
_next = next;
}

// Maximum size of the entries of any G1CardSetContainer in bits.
Copy link
Contributor

Choose a reason for hiding this comment

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

This first can be removed now.

@openjdk
Copy link

openjdk bot commented Oct 13, 2021

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

8275055: Improve HeapRegionRemSet::split_card()

Reviewed-by: sjohanss, ayang

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

  • 35e5bb5: 8269336: Malformed jdk.serialFilter incorrectly handled
  • 043cde2: 8275319: java.net.NetworkInterface throws java.lang.Error instead of SocketException
  • a91a0a5: 8233724: Remove -Wc++14-compat warning suppression in operator_new.cpp
  • 1271fbf: 8248584: Enable CHECK_UNHANDLED_OOPS for Windows fastdebug builds
  • 135cf3c: 8275439: Remove PrintVtableStats
  • 50a5723: 8274910: Compile in G1 evacuation failure injection code based on define
  • 5454a76: 8275273: Add missing HtmlStyle documentation
  • bd0bed7: 8273317: crash in cmovP_cmpP_zero_zeroNode::bottom_type()
  • 77b2789: 7124287: [macosx] JTableHeader doesn't get focus after pressing F8 key
  • c24fb85: 8275512: Upgrade required version of jtreg to 6.1
  • ... and 131 more: https://git.openjdk.java.net/jdk/compare/c032186b421c64b44397cb7aa101b40e5f93dfff...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.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 13, 2021
@kstefanj
Copy link
Contributor

👍

src/hotspot/share/gc/g1/g1CardSetContainers.cpp Outdated Show resolved Hide resolved
src/hotspot/share/gc/g1/g1CardSetContainers.hpp Outdated Show resolved Hide resolved
src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp Outdated Show resolved Hide resolved
src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp Outdated Show resolved Hide resolved
Copy link
Member

@albertnetymk albertnetymk left a comment

Choose a reason for hiding this comment

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

_heap_base_address feels more natural to live in G1CollectedHeap. Anyway, this is very subjective.

@tschatzl
Copy link
Contributor Author

_heap_base_address feels more natural to live in G1CollectedHeap. Anyway, this is very subjective.

The local cached copy is intentional: we do not want the extra indirection via G1CollectedHeap::heap(); otherwise we could simply use G1CollectedHeap::heap()->reserved().start() there instead.

@tschatzl
Copy link
Contributor Author

Thanks @albertnetymk @kstefanj and @kimbarrett for your reviews.

/integrate

@openjdk
Copy link

openjdk bot commented Oct 20, 2021

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

  • 35e5bb5: 8269336: Malformed jdk.serialFilter incorrectly handled
  • 043cde2: 8275319: java.net.NetworkInterface throws java.lang.Error instead of SocketException
  • a91a0a5: 8233724: Remove -Wc++14-compat warning suppression in operator_new.cpp
  • 1271fbf: 8248584: Enable CHECK_UNHANDLED_OOPS for Windows fastdebug builds
  • 135cf3c: 8275439: Remove PrintVtableStats
  • 50a5723: 8274910: Compile in G1 evacuation failure injection code based on define
  • 5454a76: 8275273: Add missing HtmlStyle documentation
  • bd0bed7: 8273317: crash in cmovP_cmpP_zero_zeroNode::bottom_type()
  • 77b2789: 7124287: [macosx] JTableHeader doesn't get focus after pressing F8 key
  • c24fb85: 8275512: Upgrade required version of jtreg to 6.1
  • ... and 131 more: https://git.openjdk.java.net/jdk/compare/c032186b421c64b44397cb7aa101b40e5f93dfff...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Oct 20, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 20, 2021
@openjdk
Copy link

openjdk bot commented Oct 20, 2021

@tschatzl Pushed as commit 7e28bdd.

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

@tschatzl tschatzl deleted the submit/8275055-optimize-split branch October 21, 2021 13:37
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
4 participants