Skip to content

Conversation

@ValentaTomas
Copy link
Member

@ValentaTomas ValentaTomas commented Nov 3, 2025

Note

Refactors dirty-page tracking to a new block Tracker, updates UFFD to unregister and return tracked pages via Disable(ctx), and wires changes through sandbox, build diffs, and tests.

  • Memory/UFFD:
    • Replace internal missing/dirty tracking with block.Tracker; add Disable(ctx) (*block.Tracker, error) and remove direct Dirty() from MemoryBackend.
    • uffd.New drops block-size param; Uffd.Disable now unregisters mappings (adds UFFDIO_UNREGISTER) and returns tracker; internal dirty(ctx) helper added.
    • Enforce page-size consistency in userfaultfd.NewUserfaultfdFromFd; limit in-flight requests to 4096.
  • Block:
    • Add Tracker with Add/Has/Reset/Clone/Offsets/BitSet/BlockSize; Slicer now requires BlockSize().
    • Remove old tracked slice device; new bitsetOffsets and iter-based offsets.
  • Sandbox Integration:
    • Use memory.Disable(ctx) to get dirty pages; pass dirty.BitSet() to memory diff; update serveMemory to new uffd.New signature.
  • Build/Diff:
    • Add BlockSize() to Diff implementations (NoDiff, localDiff, StorageDiff).
  • Tests/Utils:
    • Add tracker_test.go; revise cross-process test to stream Tracker.Offsets(); add utils.TransformTo iterator helper; test MemorySlicer now implements BlockSize().

Written by Cursor Bugbot for commit 8dc51d0. This will update automatically on new commits. Configure here.

Base automatically changed from uffd-refactor to main November 10, 2025 20:06
@ValentaTomas
Copy link
Member Author

I'll do some last end-to-end testing and then we should be able to merge.

@ValentaTomas ValentaTomas changed the base branch from main to sandbox-integrity November 11, 2025 03:09
Base automatically changed from sandbox-integrity to main November 11, 2025 08:33
@ValentaTomas ValentaTomas merged commit 150260d into main Dec 4, 2025
28 checks passed
@ValentaTomas ValentaTomas deleted the add-tracker branch December 4, 2025 06:18
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.

4 participants