Conversation
earthling-amzn
suggested changes
May 20, 2026
earthling-amzn
left a comment
There was a problem hiding this comment.
Let's see if we can simplify this further. I don't want to add too much complexity and/or runtime costs to satisfy these tests.
earthling-amzn
suggested changes
May 27, 2026
| } | ||
|
|
||
| // Only used for a WhiteBox full GC to enable promotions for PLABs before evacuation. PLAB | ||
| // construction defaults _allows_promotion to be false. ShenandoahRetireGCLABClosure will |
There was a problem hiding this comment.
This is probably a bug. I can't think of a good reason not to default _allows_promotion to true. Then we don't need this extra code and extra steps.
Owner
Author
There was a problem hiding this comment.
Ok, I'll set it to true and retest again.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a draft PR to get feedback on my implementation that forces all objects to be promoted for a WhiteBox full GC.
Ticket: https://bugs.openjdk.org/browse/JDK-8384221
Testing with linux-x86_64-server-fastdebug
These tests were previously failing or timing out. With this change they pass with 100 iterations each:
Notes
These changes introduces an always tenure mode only used for WhiteBox full GCs to promote objects regardless if it meets the tenuring threshold.
PLABs are constructed with promotions disabled, and remain so until the first retire.
ShenandoahRetireGCLABClosurewill enable promotions at the end of evacuation. The PLAB may also disable its own promotions mid-cycle in response to budget. We let it reconfigure itself this way during the cycle, so there is no need to disable promotions inShenandoahEnablePlabPromotionsClosure. Here is a log where I try to force promotions on the first cycle without enabling promotions for PLAB:adjust_evacuation_budgetscan set the promotion reserve smaller than a min-size PLAB, in which case no thread can allocate a promotion PLAB. To avoid this, we keep at least one min-size PLAB per worker in the promotion reserve.Not enabling promotions for the java thread's PLAB can cause the WhiteBox tests to become flakely because the PLAB is disabled on the first cycle.
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. One solution I came up with was forcing the cset to be non-empty, preventing abbreviated cycles by reconfiguring the thresholds in
ShenandoahGlobalHeuristics::choose_global_collection_set.