jdk icon indicating copy to clipboard operation
jdk copied to clipboard

8289822: G1: Make concurrent mark code owner of TAMSes

Open tschatzl opened this issue 1 year ago • 8 comments

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)
  • [x] Change must not contain extraneous whitespace
  • [x] Commit message must refer to an issue

Issue

  • JDK-8289822: G1: Make concurrent mark code owner of TAMSes (Enhancement - P4)

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

tschatzl avatar Mar 07 '24 10:03 tschatzl

:wave: 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.

bridgekeeper[bot] avatar Mar 07 '24 10:03 bridgekeeper[bot]

@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[bot] avatar Mar 07 '24 10:03 openjdk[bot]

@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[bot] avatar Mar 07 '24 11:03 openjdk[bot]

/label add hotspot-gc

albertnetymk avatar Mar 13 '24 15:03 albertnetymk

@albertnetymk The hotspot-gc label was successfully added.

openjdk[bot] avatar Mar 13 '24 15:03 openjdk[bot]

@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[bot] avatar Mar 13 '24 15:03 openjdk[bot]

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

  • 5b6b514441fcbbaa210e2cad08ce2704fdf38191: 8325362: Allow to create a simple in-memory input JavaFileObject
  • c59c41aa6e28ab1dc59e6051f85e3e9ade251b07: 8326941: Remove StringUTF16::isBigEndian
  • 6eea5d675566adca3fca88639008c6c0221450a4: 8325187: JVMTI GetThreadState says virtual thread is JVMTI_THREAD_STATE_INTERRUPTED when it no longer is
  • 053ff76e14046f796f6e10a9cb2ede1f1ae22ed6: 8308660: C2 compilation hits 'node must be dead' assert
  • e1b0af29e47b46879defce1fc44c30d4d50d0c31: 8323972: C2 compilation fails with assert(!x->as_Loop()->is_loop_nest_inner_loop()) failed: loop was transformed
  • c0fc9563a707cb01db4baf3aebede5f6b3ea08d1: 8328275: CodeCache::print_internals should not be called in PRODUCT code
  • 4ef591f71f62ee6ea8a603ed7a3e568b348b2c16: 8326964: Remove Eclipse Shared Workspaces
  • ac5b6cb2d42bdb8fb1a110ad33411b50cff4ea61: 8327757: Convert javax/swing/JSlider/6524424/bug6524424.java applet to main
  • 652fb3aa48fdfe09e827c2a06f76b3a69c711b74: 8328154: Convert sun/java2d/loops/CopyAreaSpeed.java applet test to main
  • 9059727df135dc90311bd476124f090b5766092b: 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[bot] avatar Mar 13 '24 20:03 openjdk[bot]

Thanks @albertnetymk @walulyai for your reviews /integrate

tschatzl avatar Mar 19 '24 10:03 tschatzl

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

  • 5b6b514441fcbbaa210e2cad08ce2704fdf38191: 8325362: Allow to create a simple in-memory input JavaFileObject
  • c59c41aa6e28ab1dc59e6051f85e3e9ade251b07: 8326941: Remove StringUTF16::isBigEndian
  • 6eea5d675566adca3fca88639008c6c0221450a4: 8325187: JVMTI GetThreadState says virtual thread is JVMTI_THREAD_STATE_INTERRUPTED when it no longer is
  • 053ff76e14046f796f6e10a9cb2ede1f1ae22ed6: 8308660: C2 compilation hits 'node must be dead' assert
  • e1b0af29e47b46879defce1fc44c30d4d50d0c31: 8323972: C2 compilation fails with assert(!x->as_Loop()->is_loop_nest_inner_loop()) failed: loop was transformed
  • c0fc9563a707cb01db4baf3aebede5f6b3ea08d1: 8328275: CodeCache::print_internals should not be called in PRODUCT code
  • 4ef591f71f62ee6ea8a603ed7a3e568b348b2c16: 8326964: Remove Eclipse Shared Workspaces
  • ac5b6cb2d42bdb8fb1a110ad33411b50cff4ea61: 8327757: Convert javax/swing/JSlider/6524424/bug6524424.java applet to main
  • 652fb3aa48fdfe09e827c2a06f76b3a69c711b74: 8328154: Convert sun/java2d/loops/CopyAreaSpeed.java applet test to main
  • 9059727df135dc90311bd476124f090b5766092b: 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[bot] avatar Mar 19 '24 10:03 openjdk[bot]

@tschatzl Pushed as commit f1c69ccadb83306d1bb4860ff460a253af99643c.

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

openjdk[bot] avatar Mar 19 '24 10:03 openjdk[bot]