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

8255765: Shenandoah: Isolate concurrent, degenerated and full GC #1964

Closed
wants to merge 103 commits into from

Conversation

zhengyu123
Copy link
Contributor

@zhengyu123 zhengyu123 commented Jan 6, 2021

The purpose of this patch is to isolate concurrent, degenerated and full gc implementation, so that, makes each GC implementation more straightforward and clean, and improves readability.

Current implementation emphasis code sharing, e.g. degenerated GC reuses concurrent GC's ops. It was not a problem in the beginning, when they actually behave similarly. Since concurrent GC moved root processing into concurrent phases, code started to diverge, we started to put bandages to make the shared ops work for both concurrent and degenerated GC, that made code hard to read and error prone.

The patch breaks up GCs into 3 (mainly just concurrent and degenerated GC, as full GC already standalone) easy to identify and understand classes (ShenandoahConcurrentGC, ShenandoahDegeneratedGC and ShenandoahMarkCompactGC), subclasses of ShenandoahGC class.

The three GCs still keep vmop/entry/op paradigm, but encapsulate GC control flow inside their own classes, as ShenandoahMarkCompact GC already does. So that, concurrent and degenerated GC no longer share ops and op implementations no longer need to consider other GC modes, which results in simplifying implementation and improving readability. Code sharing is achieved via helper methods provided by ShenandoahHeap.

Test:

  • hotspot_gc_shenandoah
  • nightly tests

Progress

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

Issue

  • JDK-8255765: Shenandoah: Isolate concurrent, degenerated and full GC

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/1964/head:pull/1964
$ git checkout pull/1964

Zhengyu Gu added 30 commits October 30, 2020 15:13
@openjdk
Copy link

openjdk bot commented Jan 14, 2021

@zhengyu123 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 JDK-8255765-isolate-gcs
git fetch https://git.openjdk.java.net/jdk 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 Jan 14, 2021
@openjdk openjdk bot removed the merge-conflict Pull request has merge conflict with target branch label Jan 14, 2021
@zhengyu123 zhengyu123 marked this pull request as ready for review January 14, 2021 21:14
@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 14, 2021
@mlbridge
Copy link

mlbridge bot commented Jan 14, 2021

Webrevs

Copy link
Contributor

@rkennke rkennke left a comment

Choose a reason for hiding this comment

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

Nice! I really like how that moves some burden out from ShHeap (and ShControlThread) to more apprppriate places. Just the following two remarks.

@rkennke
Copy link
Contributor

rkennke commented Jan 18, 2021

@shipilev should also look at this.

Copy link
Member

@shipilev shipilev left a comment

Choose a reason for hiding this comment

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

Some minor nits from the initial review. Please make sure tier1 and tier2 with Shenandoah still pass.

src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.hpp Outdated Show resolved Hide resolved
src/hotspot/share/gc/shenandoah/shenandoahGC.hpp Outdated Show resolved Hide resolved
src/hotspot/share/gc/shenandoah/shenandoahGC.hpp Outdated Show resolved Hide resolved
src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp Outdated Show resolved Hide resolved
Copy link
Member

@shipilev shipilev left a comment

Choose a reason for hiding this comment

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

I have only minor nits left.

@openjdk
Copy link

openjdk bot commented Jan 21, 2021

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

8255765: Shenandoah: Isolate concurrent, degenerated and full GC

Reviewed-by: rkennke, shade

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 31 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 the ready Pull request is ready to be integrated label Jan 21, 2021
Copy link
Contributor

@rkennke rkennke 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!

Copy link
Member

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

@zhengyu123
Copy link
Contributor Author

/integrate

@openjdk openjdk bot closed this Jan 21, 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 Jan 21, 2021
@openjdk
Copy link

openjdk bot commented Jan 21, 2021

@zhengyu123 Since your change was applied there have been 31 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

Pushed as commit 34eb8b3.

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

@zhengyu123 zhengyu123 deleted the JDK-8255765-isolate-gcs branch May 2, 2022 18:47
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
3 participants