Skip to content

GC poll from the last parked GC worker - #1550

Open
qinsoon wants to merge 2 commits into
mmtk:masterfrom
qinsoon:gc-poll-from-worker
Open

GC poll from the last parked GC worker#1550
qinsoon wants to merge 2 commits into
mmtk:masterfrom
qinsoon:gc-poll-from-worker

Conversation

@qinsoon

@qinsoon qinsoon commented Aug 13, 2026

Copy link
Copy Markdown
Member

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_disable API, which asks the binding to block if a concurrent GC is happening and MMTk cannot disable GC right now. If the only mutator thread calls gc_disable and 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.

}

let plan = self.plan();
if self.policy.is_gc_required(false, None, plan) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could additionally pass an argument to the plan to indicate that this is a poll from GC threads.

@qinsoon
qinsoon marked this pull request as ready for review August 17, 2026 23:14
@qinsoon
qinsoon requested a review from wks August 17, 2026 23:14

@wks wks left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@qinsoon

qinsoon commented Aug 18, 2026

Copy link
Copy Markdown
Member Author

I suggest we merge this PR after the LXR PR, in case this may cause any issue for LXR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Immediately trigger final mark pause when concurrent marking finishes

2 participants