Skip to content

Conversation

@ValentaTomas
Copy link
Member

@ValentaTomas ValentaTomas commented Oct 27, 2025

This should be only a refactor now—I tried to minimize all functional changes.


Note

Refactors UFFD into a dedicated userfaultfd type with fd helpers, replaces old mapping with a tested memory mapping, and updates integration/tests accordingly.

  • Userfaultfd refactor:
    • Introduce userfaultfd.Userfaultfd with Serve/Close, encapsulating polling, pagefault handling, and missing-page copy logic.
    • Add userfaultfd/fd.go wrapping UFFD syscalls/constants; remove old constants.go and syscalls.go.
    • Move eagain logging to userfaultfd and streamline read/poll loop.
  • Memory mapping module:
    • Replace mapping package with memory module: Region, Mapping, GetOffset, and AddressNotFoundError.
    • Add comprehensive tests in memory/mapping_test.go.
  • Orchestrator integration:
    • Update uffd.Uffd to parse region mappings, construct memory.Mapping, create userfaultfd.Userfaultfd, and call Serve.
    • Remove legacy Serve implementation and mapping types; rename buffers (regionMappings*).
  • Tests:
    • Migrate tests to userfaultfd package; update cross-process helpers to new fd API and mapping; adjust helpers and missing/missing_write tests.

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

@ValentaTomas ValentaTomas requested a review from djeebus November 7, 2025 21:49
@ValentaTomas ValentaTomas dismissed djeebus’s stale review November 7, 2025 23:01

Should be addressed now.

@ValentaTomas ValentaTomas merged commit da669f6 into main Nov 10, 2025
28 checks passed
@ValentaTomas ValentaTomas deleted the uffd-refactor branch November 10, 2025 20:06
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