-
Notifications
You must be signed in to change notification settings - Fork 36
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
8325673: GenShen: Share Reserves between Old and Young Collector #395
Conversation
👋 Welcome back kdnilsen! A progress list of the required criteria for merging this PR into |
Webrevs
|
Given that mixed evacuation will sometimes borrow up to this amount of memory from the young evacuation reserve for old evacuations, we reduce the default value to reduce the impact on normal young GC.
1. Always require that evacuation reserve quantities be established before rebuilding free set 2. Establish evacuation reserve quantities before initial rebuild of free set 3. Fix the calucation of old reserves during adjust generation sizes for next gc cycle
This reverts commit 7bb1d38.
When we round up, we introduce the risk that the new size exceeds the maximum LAB size, resulting in an assertion error.
This reverts commit 99cce53.
In the previous implementaiton, reserve quantities were only sometimes established.
@kdnilsen this pull request can not be integrated into git checkout share-collector-reserves
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 |
❗ This change is not yet ready to be integrated. |
Limit the size of old-gen by memory available in the OldCollector set following find_regions_with_alloc_capacity() (rather than limiting the size of old-gen by the total capacity of the OldCollector set, which includes used memory).
Soft capacities are established, for example, by setting NewRatio or New size on the JVM command line. GenShen, for now at least, does not honor these settings. Better performance is obtained by allowing GenShen to expand and shrink generation sizes according to application behavior. This commit also tidies up various aspects of the implementation to make adjustments to generation sizing more consistent: 1. ShenandoahGlobalHeuristics::choose_global_collection_set(): share the reserves between young and old collection to maximize evacuation of garbage-first regions, regardless of whether most garbage is found in old or young 2. ShenandoahConcurrentGC::entry_final_roots(): do not balance generations before invoking finish_rebuild() because finish_rebuild will balance generations. 3. ShenandoahFreeSet::flip_to_old_gc(): invoke force_transfer_to_young() instead of transfer_to_young() so we can override soft-capacity limits 4. ShenandoahFullGC::phase5_epilog(): Do not invoke compute_balances() or balance_generations_after_rebuilding_free_set(). Allow the free-set rebuild() implementation to do this work in a more consistent fashion. 5. ShenandoahGeneration::adjust_evacuation_budgets(): replace transfer_to_youn() with force_transfer_to_young() to avoid enforcement of soft capacity limits. 6. ShenandoahGenerationSizer::force_transfer_to_young(): new method 7. ShenandoahGenerationalFullGC::balance_generations_after_gc(): establish reserves() so that free-set rebuild() can adjust balance. Do not redundantly force transfer of regions here. 8. ShenandoahGenerationalFullGC::balance_generations_after_rebuilding_free_set(): deprecate this method. 9. ShenandoahGenerationalFullGC::compute_balances(): deprecate this method. 10. ShenandoahGenerationaStatsClosure::validate_usage() (part of Shenandoah Verification): add consistency check for generation capacities
return true; | ||
} | ||
|
||
void ShenandoahOldHeuristics::initialize_piggyback_evacs(ShenandoahCollectionSet* collection_set, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we continue using mixed
instead of piggyback
to describe collections that include young and old regions? I think mixed
is an accepted term and piggyback
feels a little bit too colloquial (also not sure if the phrase is commonly known outside of English).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion. Thanks. I'm replacing piggyback with mixed throughout (where piggyback means mixed evac). There are a few places where piggyback in Shenandoah where piggyback is used for other purposes and I'm leaving those as is.
src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few suggestions; would be great to take care of the re-order thing that confuses the github diffs. Not sure if restoring old order of those methods in shenandoahOldHeuritsics.cpp
is possible/easy. See comments inline.
Flushing these for now, but will continue in that file and remaining ones in a subsequent session later today/tomorrow.
src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.hpp
Outdated
Show resolved
Hide resolved
src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.hpp
Outdated
Show resolved
Hide resolved
src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.hpp
Outdated
Show resolved
Hide resolved
src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.cpp
Outdated
Show resolved
Hide resolved
Most invocations do not need to resize generations between prepare_to_rebuild() and finish_rebuild(), so no need to make these two independent invocations.
@kdnilsen This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 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! |
@kdnilsen This pull request has been inactive for more than 8 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 |
Allow young-gen Collector reserve to share memory with old-gen Collector reserve in order to support prompt processing of mixed evacuations, as constrained by ShenandoahOldEvacRatioPercent.
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/shenandoah.git pull/395/head:pull/395
$ git checkout pull/395
Update a local copy of the PR:
$ git checkout pull/395
$ git pull https://git.openjdk.org/shenandoah.git pull/395/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 395
View PR using the GUI difftool:
$ git pr show -t 395
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/shenandoah/pull/395.diff
Webrev
Link to Webrev Comment