GC poll from the last parked GC worker - #1550
Open
qinsoon wants to merge 2 commits into
Open
Conversation
qinsoon
commented
Aug 17, 2026
| } | ||
|
|
||
| let plan = self.plan(); | ||
| if self.policy.is_gc_required(false, None, plan) { |
Member
Author
There was a problem hiding this comment.
We could additionally pass an argument to the plan to indicate that this is a poll from GC threads.
qinsoon
marked this pull request as ready for review
August 17, 2026 23:14
Member
Author
|
I suggest we merge this PR after the LXR PR, in case this may cause any issue for LXR. |
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 PR allows the last parked GC worker to poll for a GC. When a concurrent GC has done its concurrent work, we can directly poll for a pause, instead of waiting for a failed allocation. Closes #1523.
This is not just an optimization. It is also needed for correctness. #1457 added a
gc_disableAPI, which asks the binding to block if a concurrent GC is happening and MMTk cannot disable GC right now. If the only mutator thread callsgc_disableand gets blocked, no allocation would be made. Thus no one would poll for a pause when the concurrent marking is done. The mutator is blocked to wait for the concurrent GC to finish, but the concurent GC cannot finish as no one would poll for the final mark pause.