-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8214237: Join parallel phases post evacuation #3811
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
8214237: Join parallel phases post evacuation #3811
Conversation
👋 Welcome back tschatzl! A progress list of the required criteria for merging this PR into |
Webrevs
|
/label add hotspot-gc |
@tschatzl |
@tschatzl |
// Stores whether during humongous object registration we found candidate regions. | ||
// If not, we can skip a few steps. | ||
bool _has_humongous_reclaim_candidates; | ||
uint _num_humongous_reclaim_total; // Total number of humongous objects |
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.
Comment might be misleading
The change adds:
|
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.
lgtm!
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.
This looks good, have a few small suggestions on names but nothing major. I did not check every copy-paste in detail, but skimmed it.
I suspect getting some strange numbers in the logging might be one risk, have you done any manual runs trying to compare before and after making sure everything looks reasonable.
bool G1CollectedHeap::eagerly_reclaim_enabled() const { | ||
return (G1EagerReclaimHumongousObjects && | ||
(G1CollectedHeap::heap()->has_humongous_reclaim_candidate_objects() || log_is_enabled(Debug, gc, humongous))); |
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.
This is not really "eager reclaim enabled" but "should do eager reclaim". It also feels a bit strange to have the logging check here. I see why it is needed but I wonder if it should be broken out to be two different function. Something like has_eager_reclaim_work()
and do_eager_reclaim_logging()
.
_preserved_marks_set.assert_empty(); | ||
|
||
merge_per_thread_state_info(per_thread_states); | ||
post_evacuate_cleanup_1(per_thread_states, rdcqs); |
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.
Would it make sense to include a short comment about what these two cleanup steps do?
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.
I fear that is going to be stale fairly quickly - the batchedgangtasks already contain a description of all tasks run within them, repeating that here seems just a way of waiting for it to get stale. I can't find a useful generic description either, so I'll leave it as is for now.
@tschatzl 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 99 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 |
Github actions completed fine with the latest change. Integrating. /integrate |
@tschatzl Since your change was applied there have been 105 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 14f0afe. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Hi all,
can I get reviews for this change that joins all non-object moving post evacuation tasks into two parallel batched phases?
This has the advantage of avoiding spinup and teardown of the separate tasks and also makes a few tasks that are done serially at the moment run in parallel to each other.
For that, extensive analysis of dependencies has been performed, and I found that we need two
G1BatchedGangTasks
(introduced just for this purpose):The first one,
G1PostEvacuateCollectionSetCleanupTask1
contains the following subtasks:The second one,
G1PostEvacuateCollectionSetCleanupTask2
contains the following subtasks:Feel free to propose better names for the batch tasks :) The distribution has been somewhat arbitrary with the following limitations:
Redirty Logged Cards depends on Clear Card Table - we need to clear card table scanning information from the card table before redirtying (Clear Card Table could actually split into the part that clears the "Young Gen" marks and the parts that actually contain card scan information, but it does not seem to provide an advantage).
Redirty Cards depends on *Merge PSS - that phase merge per thread DCQs into global dcq; redirty cards could of course take from the per-thread dcq if needed
Free Collection Set depends on Merge PSS to merge per thread surviving young words to single one and Recalculate Used as it updates the heap usage counters.
More dependencies between other phases not merged are noted on the JDK-8214237 page.
This change seems huge (~1k LOC changes), but actually it isn't: lots of code has been moved 1:1 from
g1CollectedHeap.cpp
to the newg1YoungGCPostEvacuateTasks.*
files.g1CollectedHeap.cpp
just got way too huge with this change so it was really useful to start splitting the young gc related things into new files like has been done for the full GC. I'll continue extending this move, but there just has to be a start somewhere.I tried to do this change in a few steps, but that unfortunately caused too many weird intermediate workarounds steps in the timing code (
G1GCPhaseTimes
). So let me try to cut down the change into steps for you.So the change can be split up into
g1YoungGCPostEvacuateTasks.cpp
: this affected dismantling existing AbstractGangTasks into main code (constructor, destructor, do_work method) and move that code to the correspondingG1AbstractSubTask
.AbstractGangTask
were moved as well close to thatG1AbstractSubTask
.G1BatchedGangTask
And the review tasks should roughly be:
Here's a summary for the copy&paste changes:
RedirtyLoggedCardTableEntryClosure
moved verbatim tog1YoungGCPostEvacuateTasks.cpp
G1RedirtyLoggedCardsTask
were transformed into aG1AbstractSubTask
G1CollectedHeap::remove_self_forwarding_pointers()
andG1CollectedHeap::restore_after_evac_failure
were transformed into aG1AbstractSubTask
G1PostEvacuateCollectionSetCleanupTask1::RecalculateUsedTask
G1AbstractSubTask
that just calls the same methodG1FreeCollectionSetTask
moved toG1PostEvacuateCollectionSetCleanupTask2::FreeCollectionSetTask
G1FreeHumongousRegionClosure
moved verbatim tog1YoungGCPostEvacuateTasks.cpp
, and wrapped into aG1AbstractSubTask
Minor other things:
Feel free to ask questions.
Testing: tier1-5 multiple times
Thanks,
Thomas
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3811/head:pull/3811
$ git checkout pull/3811
Update a local copy of the PR:
$ git checkout pull/3811
$ git pull https://git.openjdk.java.net/jdk pull/3811/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3811
View PR using the GUI difftool:
$ git pr show -t 3811
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3811.diff