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

JDK-8315479: GenShen: Expand old-gen while selecting collection set during GLOBAL GC #318

Closed

Conversation

kdnilsen
Copy link
Contributor

@kdnilsen kdnilsen commented Sep 1, 2023

With GenShen, the size of old generation is as small as possible in order to maximize memory available to young gen. This generally allows less frequent (and therefore more efficient) young-gen collections.

Under normal operation (concurrent marking of old followed by a series of mixed evacuations), old-gen is expanded at the end of a previous GC cycle in order to accommodate evacuation of mixed-evacuation candidates.

However, when we do a GLOBAL collection, we need to expand OLD gen during the selection of the collection set, depending on how many old-gen regions are selected to be evacuated during the GC evacuation phase. This PR makes the change.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (1 review required, with at least 1 Committer)

Issue

  • JDK-8315479: GenShen: Expand old-gen while selecting collection set during GLOBAL GC (Sub-task - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 318

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/shenandoah/pull/318.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 1, 2023

👋 Welcome back kdnilsen! 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 added the rfr Pull request is ready for review label Sep 1, 2023
@mlbridge
Copy link

mlbridge bot commented Sep 1, 2023

Webrevs

Copy link
Contributor

@earthling-amzn earthling-amzn left a comment

Choose a reason for hiding this comment

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

A couple of minor nits.

@@ -101,31 +125,50 @@ void ShenandoahGlobalHeuristics::choose_global_collection_set(ShenandoahCollecti
for (size_t idx = 0; idx < size; idx++) {
ShenandoahHeapRegion* r = data[idx]._region;
if (cset->is_preselected(r->index())) {
assert(false, "There should be no preselected regions during GLOBAL GC");
Copy link
Contributor

Choose a reason for hiding this comment

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

Slightly more readable:

 fatal("There should be no preselected regions during GLOBAL GC");

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I'll make this change.

if ((new_cset <= max_old_cset) && (r->garbage() > garbage_threshold)) {
add_region = true;
old_cur_cset = new_cset;
}
} else if (r->age() < tenuring_threshold) {
} else {
// r->is_young() && (r->age() < tenuring_threshold)
Copy link
Contributor

Choose a reason for hiding this comment

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

assert?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll make this change also.

@kdnilsen
Copy link
Contributor Author

kdnilsen commented Sep 5, 2023

Though GHA checks have all passed, our internal CI pipelines have encountered a few problems:

  1. stress_dacapo (5 of 5 runs) encounters:
#  Error: Verify init-mark remembered set violation; clean card should be dirty

This issue is being addressed under separate ticket: https://bugs.openjdk.org/browse/JDK-8315044

if ((new_cset <= max_old_cset) && (r->garbage() > garbage_threshold)) {
add_region = true;
old_cur_cset = new_cset;
}
} else if (r->age() < tenuring_threshold) {
} else {
assert(r->is_young() && (r->age() < tenuring_threshold), "DeMorgan\'s law");
Copy link
Contributor

Choose a reason for hiding this comment

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

Not quite DeMorgan's law because r could be unaffiliated (it isn't supposed to be, of course). Does the straight quote needs to be escaped?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm fixing the message here.

@openjdk
Copy link

openjdk bot commented Sep 6, 2023

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

8315479: GenShen: Expand old-gen while selecting collection set during GLOBAL GC

Reviewed-by: wkemper

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

  • c4d0a24: 8315044: GenShen: Verifier detects clean card should be dirty
  • 2d76fb1: 8315478: GenShen: Tolerate round-off errors in preselected promotion budget

Please see this link for an up-to-date comparison between the source branch of this pull request and 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 Sep 6, 2023
@kdnilsen
Copy link
Contributor Author

kdnilsen commented Sep 6, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Sep 6, 2023

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

  • c4d0a24: 8315044: GenShen: Verifier detects clean card should be dirty
  • 2d76fb1: 8315478: GenShen: Tolerate round-off errors in preselected promotion budget

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Sep 6, 2023

@kdnilsen Pushed as commit 33a8085.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
2 participants