fix(uffd): dedupe deferred page faults#2864
Conversation
PR SummaryLow Risk Overview Reviewed by Cursor Bugbot for commit 2b7e091. Bugbot is set up for automated code reviews on this repo. Configure here. |
❌ 2 Tests Failed:
View the full list of 2 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
There was a problem hiding this comment.
Code Review
This pull request introduces deduplication of deferred pagefaults by address in the deferredFaults struct to prevent redundant wakeups. It adds a byAddr map to track and deduplicate addresses, updates the Serve loop to only signal wakeups when a new pagefault is successfully deferred, and includes unit tests to verify this behavior. There are no review comments, and no issues were identified in the changes.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1824ece8d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 306359e1ab
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Drop the dedupe map after draining so one burst of unique addresses does not retain map capacity for the sandbox lifetime.
Key deferred page faults by page boundary so same-page offsets coalesce before retry.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dd691d5002
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Convert the cgo pagefault address to uint64 before page-boundary dedupe.
Round cgo pagefault addresses to the page boundary before deduping deferred retries.
Summary
Deduplicate deferred UFFD faults by address so repeated EAGAINs for the same page do not flood the retry queue or wake loop.
Test plan