mm/uffd: Add feature bit UFFD_FEATURE_WP_UNPOPULATED
Status from this message: [merged mm-stable] selftests-mm-smoke-test-uffd_feature_wp_unpopulated.patch removed from -mm tree
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest2 patches 6 repliesApplied 2/2
- v32 patches 5 repliesSuperseded
- v21 patch 19 repliesSuperseded
Changes in v4 from the cover letter
- s/handle_pte_missing/do_pte_missing/, fix spellings, etc. [David]
- Add a helper userfaultfd_wp_use_markers() [David]
- Update userfaultfd.rst describing the new feature bit
Patches in v4 All 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | mm/uffd: UFFD_FEATURE_WP_UNPOPULATEDDocumentation/ fs/ include/ +4 more | +154 | 3 replies | Applied |
| 2/2 | selftests/mm: Smoke test UFFD_FEATURE_WP_UNPOPULATEDtools/ | +43 | 3 replies | Applied |
Reviews trailers per patch
1 of 2 patches has a Reviewed-by or Acked-by.
| Patch | David Hildenbrand |
|---|---|
| 1/2 | A-b |
| 2/2 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v4 0/2] mm/uffd: Add feature bit UFFD_FEATURE_WP_UNPOPULATED
v1: https://lore.kernel.org/r/[email protected]
v2: https://lore.kernel.org/r/[email protected]
v3: https://lore.kernel.org/r/[email protected]
v4:
- s/handle_pte_missing/do_pte_missing/, fix spellings, etc. [David]
- Add a helper userfaultfd_wp_use_markers() [David]
- Update userfaultfd.rst describing the new feature bit
The new feature bit will make anonymous memory acts the same like file memory on userfaultfd-wp in that it'll also wr-protect none ptes.
It can be useful in two cases:
(1) Uffd-wp app that needs to wr-protect none ptes like QEMU snapshot, so pre-fault can be replaced by enabling this flag and speed up protections
(2) It helps to implement async uffd-wp mode that Muhammad is working on [1]
It's debateable whether this is the most ideal solution because with the new feature bit set, wr-protect none pte needs to pre-populate the pgtables to the last level (PAGE_SIZE). But it seems fine so far to service either purpose above, so we can leave optimizations for later.
The series brings pte markers to anonymous memory too. There's some change in the common mm code path in the 1st patch, great to have some eye looking at it, but hopefully they're still relatively straightforward.
Thanks,
[1] https://lore.kernel.org/all/Y+v2HJ8+3i%2FKzDBu@x1n/
Peter Xu (2):
mm/uffd: UFFD_FEATURE_WP_UNPOPULATED selftests/mm: Smoke test UFFD_FEATURE_WP_UNPOPULATED
Documentation/admin-guide/mm/userfaultfd.rst | 17 ++++++ fs/userfaultfd.c | 16 ++++++ include/linux/mm_inline.h | 6 +++ include/linux/userfaultfd_k.h | 23 ++++++++ include/uapi/linux/userfaultfd.h | 10 +++- mm/memory.c | 56 +++++++++++++++----- mm/mprotect.c | 51 ++++++++++++++---- tools/testing/selftests/mm/userfaultfd.c | 45 +++++++++++++++- 8 files changed, 197 insertions(+), 27 deletions(-)
Signature · 1 line
2.39.1