8381549: GenShen: Global collections skip coalesce and fill when the collection set is empty#30543
8381549: GenShen: Global collections skip coalesce and fill when the collection set is empty#30543earthling-amzn wants to merge 2 commits intoopenjdk:masterfrom
Conversation
…t (even if it is empty)
|
👋 Welcome back wkemper! A progress list of the required criteria for merging this PR into |
|
@earthling-amzn 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 20 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. ➡️ To integrate this PR with the above commit message to the |
|
@earthling-amzn The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
What was the heap walk that tried to follow one of these references? Are we talking about a dead (unmarked) object? Would that not be skipped because of using the valid (complete) marking bit map during such a walk? (Was it dirty card / remset scanning of old gen?) Something else? Change looks good, but wanted to make sure I understood the need for the coalesce and fill necessary for a linear walk over the region. |
|
In this case, the heap walk was indeed a remembered set scan. The remembered set scan cannot use the mark bitmap for old during old marking. The scan relies on old, no longer reachable objects, being filled in before old marking resets the bitmap. |
kdnilsen
left a comment
There was a problem hiding this comment.
I have some questions about the intent here?
| // eligible for coalescing. As implemented now, this has the side effect of possibly initiating mixed-evacuations | ||
| // after a global cycle for old regions that were not included in this collection set. | ||
| heap->old_generation()->prepare_for_mixed_collections_after_global_gc(); | ||
| heap->old_generation()->update_old_regions_after_global_cycle(); |
There was a problem hiding this comment.
I'm not sure we want to make this change. IIUC, as currently implemented, we may end a Global GC with many candidates for mixed evacuation. While this means "completion" of the Global GC is somewhat delayed, it also means the Global GC has a much smaller impact on the normal cadence of young collections.
What is the impact of this change?
- Does it force us to do all mixed evacuation in a single cycle?
- Does it reduce the amount of mixed evacuation that we are able to perform following an "old mark"?
There was a problem hiding this comment.
Sorry for the panic. This is just a name change?
There was a problem hiding this comment.
In this context, "update" does not mean update-refs. It means:
"update" the internal list of mixed-evacuation candidates?
"update" the gc log?
I guess I was a bit confused by the name of this function. Help me understand what we are trying to communicate with this name?
There was a problem hiding this comment.
I am open to better names. In retrospect, I made the change to skip this function call when the collection set is empty because of the old name: prepare_for_mixed_collections_after_global_gc. The function does much more than prepare for mixed collections. Critically, if there are no collection candidates at all, it must still transition the old generation to the FILLING state so that dead objects are replaced with array primitives. Maybe transition_old_generation_after_global_gc?
There was a problem hiding this comment.
Thanks. I like that name better.
|
|
||
| bool entry_coalesce_and_fill(); | ||
| void prepare_for_mixed_collections_after_global_gc(); | ||
| void transition_old_generation_after_global_gc(); |
There was a problem hiding this comment.
Thanks for the nice explanation in the PR discussion/convo w/Kelvin.
Might be a good idea to add a one-sentence documentation comment for the method here while you are here may be? I realize the method itself is fairly small, but ... :-)
There was a problem hiding this comment.
I shall add one in a subsequent PR. Thank you!
|
/integrate |
|
Going to push as commit f21e47d.
Your commit was automatically rebased without conflicts. |
|
@earthling-amzn Pushed as commit f21e47d. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
When objects become unreachable in old regions they will no longer have their references updated. If a heap walk tries to follow one of these references, it may encounter garbage and crash. This step was inadvertently skipped by an erroneous code change in a recent refactoring.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/30543/head:pull/30543$ git checkout pull/30543Update a local copy of the PR:
$ git checkout pull/30543$ git pull https://git.openjdk.org/jdk.git pull/30543/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 30543View PR using the GUI difftool:
$ git pr show -t 30543Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/30543.diff
Using Webrev
Link to Webrev Comment