Add support for UFFDIO_CONTINUE and UFFDIO_REGISTER_MODE_MINOR #72
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With Linux 5.13, UFFD got support for intercepting minor faults (e.g. where the page to be faulted in is present in the page cache, and only the userspace page table entries need to be established). This was realized by adding a new mode,
MODE_MINOR
, upon which the uffd will receive events withUFFD_PAGEFAULT_FLAG_MINOR
set. These can then be resolved by issuing theUFFDIO_CONTINUE
ioctl, which operates almost exactly likeUFFDIO_COPY
, expect that it doesnt do any memory population (since for minor faults, the memory contents are already there, in the page cache).Since this adds a new linux version based feature flag to userfaultfd-sys (and thus userfaultfd), I added some preliminary commits to try to avoid having to duplicate the ever-increasing number of uffd-related constants into yet another file, but if that's not wanted, am also happy to drop those.