Skip to content

Conversation

@ValentaTomas
Copy link
Member

@ValentaTomas ValentaTomas commented Nov 3, 2025

Note

Replace dirty-page tracking with a thread-safe bitset Tracker, add UFFD unregister support, and make memory backend Disable/Dirty context-aware across sandbox and UFFD.

  • Block tracking:
    • Introduce block.Tracker (thread-safe bitset) with Add, Has, Reset, BitSet, Clone, BlockSize; add comprehensive tests.
  • UFFD integration:
    • Replace sync.Map/TrackedSliceDevice with Tracker for missingRequests; use Add to de-dup faults.
    • Add unregister support via UFFDIO_UNREGISTER and unregister(); expose Userfaultfd.Unregister() and wire through Uffd.Disable(ctx).
    • Update constructors to pass page size; adjust message handling and tests to read offsets from Tracker.
  • API changes:
    • Update MemoryBackend to Disable(ctx) and Dirty(ctx) (*block.Tracker, error); migrate NoopMemory and Uffd accordingly.
  • Sandbox:
    • Use new memory.Disable(ctx) and memory.Dirty(ctx); pass dirty.BitSet() to memory diff creation.

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

@ValentaTomas
Copy link
Member Author

I want to do a few more end to end tests, but it should be ready to merge right after https://github.com/e2b-dev/infra/tree/uffd-refactor

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.

3 participants