Skip to content

8289822: G1: Make concurrent mark code owner of TAMSes#18150

Closed
tschatzl wants to merge 10 commits intoopenjdk:masterfrom
tschatzl:submit/8289822-concurrent-mark-tams-owner
Closed

8289822: G1: Make concurrent mark code owner of TAMSes#18150
tschatzl wants to merge 10 commits intoopenjdk:masterfrom
tschatzl:submit/8289822-concurrent-mark-tams-owner

Conversation

@tschatzl
Copy link
Contributor

@tschatzl tschatzl commented Mar 7, 2024

Hi all,

please review this change that moves TAMS ownership and handling out of HeapRegion into G1ConcurrentMark.

The rationale is that it's intrinsically a data structure only used by the marking, and only interesting during marking, so attaching it to the always present HeapRegion isn't fitting.

This also moves some code that is about marking decisions out of HeapRegion.

In this change the TAMSes are still maintained and kept up to date as long as the HeapRegion exists (basically always) as the snapshotting of the marking does not really snapshot ("copy over the HeapRegions that existed at the time of the snapshot, only ever touching them), but assumes that they exist even for uncommitted (or free) regions due to the way it advances the global finger pointer.
I did not want to change this here.

This is also why HeapRegion still tells G1ConcurrentMark to update the TAMS in two places (when clearing a region and when resetting during full gc).

Another option I considered when implementing this is clearing all marking statistics (G1ConcurrentMark::clear_statistics) at these places in HeapRegion because it decreases the amount of places where this needs to be done (maybe one or the other place isn't really necessary already). I rejected it because this would add some work that is dependent on the number of worker threads (particularly) into HeapRegion::hr_clear(). This change can be looked at by viewing at all but the last commit.

Testing: tier1-4, gha

Thanks,
Thomas


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-8289822: G1: Make concurrent mark code owner of TAMSes (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 18150

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

Using diff file

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

Webrev

Link to Webrev Comment

Thomas Schatzl added 4 commits March 6, 2024 13:42
@bridgekeeper
Copy link

bridgekeeper bot commented Mar 7, 2024

👋 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 openjdk bot changed the title 8289822 8289822: Make concurrent mark code owner of TAMSes Mar 7, 2024
@openjdk
Copy link

openjdk bot commented Mar 7, 2024

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

  • hotspot

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 hotspot-dev@openjdk.org label Mar 7, 2024
…nge) to not potentially make HeapRegion::hr_clear() too slow
@tschatzl tschatzl force-pushed the submit/8289822-concurrent-mark-tams-owner branch from d27cc21 to a5bbab8 Compare March 7, 2024 11:16
@openjdk
Copy link

openjdk bot commented Mar 7, 2024

@tschatzl Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information.

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

mlbridge bot commented Mar 7, 2024

Webrevs

@albertnetymk
Copy link
Member

/label add hotspot-gc

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

openjdk bot commented Mar 13, 2024

@albertnetymk
The hotspot-gc label was successfully added.

@openjdk
Copy link

openjdk bot commented Mar 13, 2024

@tschatzl 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 submit/8289822-concurrent-mark-tams-owner
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 Mar 13, 2024
@openjdk
Copy link

openjdk bot commented Mar 13, 2024

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

8289822: G1: Make concurrent mark code owner of TAMSes

Reviewed-by: ayang, iwalulya

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

  • 5b6b514: 8325362: Allow to create a simple in-memory input JavaFileObject
  • c59c41a: 8326941: Remove StringUTF16::isBigEndian
  • 6eea5d6: 8325187: JVMTI GetThreadState says virtual thread is JVMTI_THREAD_STATE_INTERRUPTED when it no longer is
  • 053ff76: 8308660: C2 compilation hits 'node must be dead' assert
  • e1b0af2: 8323972: C2 compilation fails with assert(!x->as_Loop()->is_loop_nest_inner_loop()) failed: loop was transformed
  • c0fc956: 8328275: CodeCache::print_internals should not be called in PRODUCT code
  • 4ef591f: 8326964: Remove Eclipse Shared Workspaces
  • ac5b6cb: 8327757: Convert javax/swing/JSlider/6524424/bug6524424.java applet to main
  • 652fb3a: 8328154: Convert sun/java2d/loops/CopyAreaSpeed.java applet test to main
  • 9059727: 8327182: Move serverAlias into the loop
  • ... and 69 more: https://git.openjdk.org/jdk/compare/49ce85fae9f06d05367c94615532f6ff87952c79...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 removed the merge-conflict Pull request has merge conflict with target branch label Mar 14, 2024
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.

Maybe add G1: in the title?

@tschatzl tschatzl changed the title 8289822: Make concurrent mark code owner of TAMSes 8289822: G1: Make concurrent mark code owner of TAMSes Mar 14, 2024
@tschatzl tschatzl requested a review from albertnetymk March 15, 2024 15:52
@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 18, 2024
Copy link
Member

@walulyai walulyai left a comment

Choose a reason for hiding this comment

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

LGTM!

@tschatzl
Copy link
Contributor Author

Thanks @albertnetymk @walulyai for your reviews
/integrate

@openjdk
Copy link

openjdk bot commented Mar 19, 2024

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

  • 5b6b514: 8325362: Allow to create a simple in-memory input JavaFileObject
  • c59c41a: 8326941: Remove StringUTF16::isBigEndian
  • 6eea5d6: 8325187: JVMTI GetThreadState says virtual thread is JVMTI_THREAD_STATE_INTERRUPTED when it no longer is
  • 053ff76: 8308660: C2 compilation hits 'node must be dead' assert
  • e1b0af2: 8323972: C2 compilation fails with assert(!x->as_Loop()->is_loop_nest_inner_loop()) failed: loop was transformed
  • c0fc956: 8328275: CodeCache::print_internals should not be called in PRODUCT code
  • 4ef591f: 8326964: Remove Eclipse Shared Workspaces
  • ac5b6cb: 8327757: Convert javax/swing/JSlider/6524424/bug6524424.java applet to main
  • 652fb3a: 8328154: Convert sun/java2d/loops/CopyAreaSpeed.java applet test to main
  • 9059727: 8327182: Move serverAlias into the loop
  • ... and 69 more: https://git.openjdk.org/jdk/compare/49ce85fae9f06d05367c94615532f6ff87952c79...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Mar 19, 2024

@tschatzl Pushed as commit f1c69cc.

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

@tschatzl tschatzl deleted the submit/8289822-concurrent-mark-tams-owner branch June 11, 2024 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot hotspot-dev@openjdk.org hotspot-gc hotspot-gc-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants