Skip to content

8380526: G1: Remove "last young" use for the Prepare Mixed GC#30336

Closed
tschatzl wants to merge 13 commits intoopenjdk:masterfrom
tschatzl:submit/8380526-remove-last-young
Closed

8380526: G1: Remove "last young" use for the Prepare Mixed GC#30336
tschatzl wants to merge 13 commits intoopenjdk:masterfrom
tschatzl:submit/8380526-remove-last-young

Conversation

@tschatzl
Copy link
Copy Markdown
Contributor

@tschatzl tschatzl commented Mar 20, 2026

Hi all,

please review this change that removes the "Last Young" nomenclature for the "Prepare Mixed" gc. The additional name just confuses.

Testing: 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-8380526: G1: Remove "last young" use for the Prepare Mixed GC (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 30336

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

Using diff file

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

Using Webrev

Link to Webrev Comment

Thomas Schatzl and others added 10 commits March 10, 2026 09:32
Hi all,

  please review this change that makes `G1CollectorState` get the concurrent cycle state directly from `G1ConcurrentMark[Thread]` instead of, in multiple places set the current state separately. This is kind of error-prone, as https://bugs.openjdk.org/browse/JDK-8378952, which this change also implicitly fixes, shows.

Other notes:
  * I expanded the `ServiceState` in `G1ConcurrentMarkThread` instead of adding a separate variable holding whether this is a full or undo concurrent cycle. This avoids potential races between those two too.
  * be more consistent with `Concurrent Cycle` (the whole thing) vs. `Concurrent Marking` throughout
  * renamed the "clear bitmap" state to "reset for next cycle` since clearing the bitmap is only one part of that subphase of the concurrent cycle.
  * made concurrent cycle state queries always go through `G1CollectorState`
  * fixed `in_something` to `is_in_something` for `G1CollectorState` as per style guideline
  * extended evacuation failure injection to include reset for next cycle for the `G1GCAllocationFailureALotDuringConcMark` value; I thought it does not hurt and it already covered both mark and rebuild or scrub

Testing: tier1-5

Thanks,
  Thomas
Hi all,

  please review this change that changes `G1CollectorState` to use a single state variable for GC pause phasing instead of multiple bools.

This reduces clutter checking validity of these flags, and imo makes the state very explicit with the usual advantages in readability.

This is based on PR#30144, so please review that one first.

Testing: tier1-5, gha

Thanks,
  Thomas
…ause_type()` because it covers all types of pauses now
Hi all,

  please review this change that removes the "Last Young" nomenclature for the "Prepare Mixed" gc. The additional name just confuses.

Testing: gha

Thanks,
  Thomas
@bridgekeeper
Copy link
Copy Markdown

bridgekeeper bot commented Mar 20, 2026

👋 Welcome back tschatzl! A progress list of the required criteria for merging this PR into pr/30330 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
Copy Markdown

openjdk bot commented Mar 20, 2026

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

8380526: G1: Remove "last young" use for the Prepare Mixed GC

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 12 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 changed the title 8380526 8380526: G1: Remove "last young" use for the Prepare Mixed GC Mar 20, 2026
@openjdk openjdk bot added the hotspot-gc hotspot-gc-dev@openjdk.org label Mar 20, 2026
@openjdk
Copy link
Copy Markdown

openjdk bot commented Mar 20, 2026

@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 rfr Pull request is ready for review label Mar 20, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge bot commented Mar 20, 2026

Webrevs

@openjdk-notifier openjdk-notifier bot changed the base branch from pr/30330 to master March 23, 2026 15:53
@openjdk-notifier
Copy link
Copy Markdown

The parent pull request that this pull request depends on has now been integrated and the target branch of this pull request has been updated. This means that changes from the dependent pull request can start to show up as belonging to this pull request, which may be confusing for reviewers. To remedy this situation, simply merge the latest changes from the new target branch into this pull request by running commands similar to these in the local repository for your personal fork:

git checkout submit/8380526-remove-last-young
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# if there are conflicts, follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk
Copy link
Copy Markdown

openjdk bot commented Mar 23, 2026

@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/8380526-remove-last-young
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 23, 2026
@openjdk openjdk bot removed the merge-conflict Pull request has merge conflict with target branch label Mar 23, 2026
* reorder elements in Pause type to correspond to typical execution (i.e. Prepare Mixed last)

// Phase getters
bool is_in_young_only_phase() const { return _phase == Phase::YoungNormal || _phase == Phase::YoungConcurrentStart || _phase == Phase::YoungLastYoung; }
bool is_in_young_only_phase() const { return _phase == Phase::YoungNormal || _phase == Phase::YoungConcurrentStart || _phase == Phase::YoungPrepareMixed; }
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.

Maybe the impl can be broken into multiple lines.

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.

_phase <= Phase::YoungPrepareMixed; or do we deliberately choose not to rely on the enum ordering?

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.

Maybe the impl can be broken into multiple lines

I was going to do this in PR#30399

_phase <= Phase::YoungPrepareMixed; or do we deliberately choose not to rely on the enum ordering?

Deliberate, after changing it to explicit values in some earlier change.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 24, 2026
@tschatzl
Copy link
Copy Markdown
Contributor Author

Thanks @albertnetymk @walulyai for your reviews
/integrate

@openjdk
Copy link
Copy Markdown

openjdk bot commented Mar 24, 2026

Going to push as commit d0d85cd.
Since your change was applied there have been 12 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 Mar 24, 2026
@openjdk openjdk bot closed this Mar 24, 2026
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Mar 24, 2026
@openjdk
Copy link
Copy Markdown

openjdk bot commented Mar 24, 2026

@tschatzl Pushed as commit d0d85cd.

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

@tschatzl tschatzl deleted the submit/8380526-remove-last-young branch March 24, 2026 15:45
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

Development

Successfully merging this pull request may close these issues.

3 participants