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

8312116 GenShen: make instantaneous allocation rate triggers more timely #327

Conversation

kdnilsen
Copy link
Contributor

@kdnilsen kdnilsen commented Sep 18, 2023

When heuristics fail to trigger because an instantaneous "allocation spike" is not so large as to consume all available memory before GC completes, this assessment is based on an assumption that the allocation rate remains constant, and it ignores the time that will be lost due to the _interval between consecutive allocation spike measurements.

This PR watches for "acceleration" of allocation rates. When acceleration of allocation is detected in 3 consecutive allocation spike measurements, it calculates a best-fit curve (assuming constant acceleration) and predicts the memory to be consumed during the time that spans both the next sample interval and the GC effort that follows it. If the memory to be allocated according to anticipated acceleration of allocations during this time span exceeds what is available, we trigger immediately.


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)

Integration blockers

 ⚠️ Too few reviewers with at least role committer found (have 0, need at least 1) (failed with updated jcheck configuration in pull request)
 ⚠️ Whitespace errors (failed with updated jcheck configuration in pull request)

Issue

  • JDK-8312116: GenShen: make instantaneous allocation rate triggers more timely (Sub-task - P3)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 327

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

Using diff file

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

Webrev

Link to Webrev Comment

@kdnilsen kdnilsen marked this pull request as draft September 18, 2023 17:07
@kdnilsen
Copy link
Contributor Author

I'm leaving this in draft mode until I complete functional and performance testing and remove the temporary instrumentation code.

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 18, 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.

@kdnilsen
Copy link
Contributor Author

Experiments with various workloads show these changes to decrease the number of degenerated GCs. In some cases, the greater sensitivity of the acceleration trigger causes more frequent GCs than without it. I am experimenting with various configuration options on multiple workloads to determine an "optimal" default configuration.

@kdnilsen kdnilsen marked this pull request as ready for review September 19, 2023 19:38
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 19, 2023
@mlbridge
Copy link

mlbridge bot commented Sep 19, 2023

Webrevs

@openjdk openjdk bot removed the rfr Pull request is ready for review label Sep 25, 2023
I'm filing a new ticket to explore deadlock issue related to
ShenandoahControlThread::_regulator_lock.  The issue was last observed
on this branch.  New changes that we are about to integrate will likely
make it much more difficult to reproduce the issue.
@kdnilsen kdnilsen marked this pull request as draft September 28, 2023 22:15
Some debugging and instrumentation, which will be removed
Better handling of humongous allocations, which will be upstreamed in a
separate patch.
A new triggering heuristic to reduce the length of idle spans as very
long idle spans are causing degenerated cycles when they collide with
allocation and promotion spikes.
@openjdk
Copy link

openjdk bot commented Oct 2, 2023

@kdnilsen 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 make-instantaneous-alloc-rate-trigger-quicker
git fetch https://git.openjdk.org/shenandoah.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 Oct 2, 2023
@openjdk openjdk bot removed the merge-conflict Pull request has merge conflict with target branch label Oct 2, 2023
@openjdk
Copy link

openjdk bot commented Oct 6, 2023

⚠️ @kdnilsen This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

@kdnilsen
Copy link
Contributor Author

This now passes all regression tests. However, performance is not acceptable. Going to do a bit of refinement.

If we decide to change these default values, we will need to arrange for
GenShen default to be different than SingleShen default.  Setting these
defaults to experiment with our performance pipeline.

Note that we need to sample more frequently if we are going to rely on
ability to quickly respond to changes in allocation rate.  When we have
the ability to quickly respond to changes in allocation rate, it is more
important to forget history more quickly.  Otherwise, we have overly
conservative triggering because we do not recognize that occassionally
long cycles are not representative of typical performance.
This code does not work in its current structure.  Am uploading commit
so I can debug in a different environment.
Throttling desires to know allocatable memory.  After old marking, we
may add immediate garbage to free set, so we should recalibrate the GC
trigger to make use of this increased allocation pool.
At start of this branch, the default value was 3.  I experimented with
larger value, but changing value on this branch is not appropriate.
Perhaps further study in a separate context will motivate a change to
this value.
@openjdk openjdk bot added the merge-conflict Pull request has merge conflict with target branch label Nov 13, 2023
@openjdk openjdk bot removed the merge-conflict Pull request has merge conflict with target branch label Nov 14, 2023
@openjdk openjdk bot added the merge-conflict Pull request has merge conflict with target branch label Dec 15, 2023
@bridgekeeper
Copy link

bridgekeeper bot commented Dec 21, 2023

@kdnilsen This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 15, 2024

@kdnilsen This pull request has been inactive for more than 16 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.

@bridgekeeper bridgekeeper bot closed this Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-conflict Pull request has merge conflict with target branch
Development

Successfully merging this pull request may close these issues.

1 participant