8384221: GenShen: WhiteBox full GC promotion is not reliable#31302
8384221: GenShen: WhiteBox full GC promotion is not reliable#31302pf0n wants to merge 2 commits into
Conversation
|
👋 Welcome back pf0n! A progress list of the required criteria for merging this PR into |
|
@pf0n 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: 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 35 new commits pushed to the
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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@earthling-amzn, @ysramakrishna) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
The total number of required reviews for this PR has been set to 2 based on the presence of this label: |
Webrevs
|
earthling-amzn
left a comment
There was a problem hiding this comment.
Looks good. Requested a minor change.
| if (gen_heap->age_census()->is_always_tenure()) { | ||
| // Cap excess_old at one min-PLAB per worker so this much stays in old's promotion reserve | ||
| // instead of being transferred to young. | ||
| const size_t min_plab_total = gen_heap->plab_min_size() * HeapWordSize * heap->workers()->max_workers(); |
There was a problem hiding this comment.
In other words, we are trying to keep old from giving any capacity to young so that old can hold all of the promotions?
ysramakrishna
left a comment
There was a problem hiding this comment.
Looks good to me, modulo one minor comment in passing re "_allows_promotion" field default value change.
| _promotion_failure_count(0), | ||
| _promotion_failure_words(0), | ||
| _allows_promotion(false), | ||
| _allows_promotion(true), |
There was a problem hiding this comment.
This is interesting, and to me somewhat unexpected.
Did this require any changes elsewhere? I'd have expected this to be the default setting, but I see calls to enable/disable promotions on plab's at various places. I wonder if this is used only for sanity checking and should just be a debug-only field used in assertion checks, or if it's used for control-flow in places.
Probably worth a closer look.
There are tests that issue a WhiteBox full GC and check whether the object was promoted. If it wasn't, the test either retries until promotion succeeds or fails automatically. GenShen fails these tests because it never promotes on the first cycle and isn't guaranteed to promote on later ones.
Fix
Introduce an always tenure mode only used for WhiteBox full GCs to promote objects regardless if its age does not meet the tenuring threshold.
Testing with linux-x86_64-server-fastdebug
These tests were previously failing or timing out. With this change they pass with 100 iterations each:
Additional testing:
hotspot_gc_shenandoahNotes
Having a tenuring threshold of 0 won't work because certain assertions will fire and calculations would break.
ShenandoahGenerationalHeuristics::adjust_evacuation_budgetscan set the promotion reserve smaller than a min-size PLAB, in which case no thread can allocate a PLAB. To avoid this, we keep at least one min-size PLAB per worker in the promotion reserve.There's a possibility of abbreviated cycles occurring. In an abbreviated cycle, no evacuation occurs, so if no regions are eligible for promote-in-place, no objects will be promoted. We can try to force the cset to be non-empty which prevents abbreviated cycles. We reconfigure specific thresholds in
ShenandoahGlobalHeuristics::choose_global_collection_setto make this work.Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/31302/head:pull/31302$ git checkout pull/31302Update a local copy of the PR:
$ git checkout pull/31302$ git pull https://git.openjdk.org/jdk.git pull/31302/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 31302View PR using the GUI difftool:
$ git pr show -t 31302Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/31302.diff
Using Webrev
Link to Webrev Comment