linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/4] mm: userfaultfd: refactor and add UFFDIO_CONTINUE_MODE_WP
@ 2023-03-14 22:12 Axel Rasmussen
  2023-03-14 22:12 ` [PATCH v5 1/4] mm: userfaultfd: rename functions for clarity + consistency Axel Rasmussen
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Axel Rasmussen @ 2023-03-14 22:12 UTC (permalink / raw)
  To: Alexander Viro, Andrew Morton, Hugh Dickins, Jan Kara,
	Liam R. Howlett, Matthew Wilcox, Mike Kravetz, Mike Rapoport,
	Muchun Song, Nadav Amit, Peter Xu, Shuah Khan
  Cc: James Houghton, linux-fsdevel, linux-kernel, linux-mm,
	linux-kselftest, Axel Rasmussen

This series, currently based on 6.3-rc1, is divided into two parts:

- Commits 1-3 refactor userfaultfd ioctl code without behavior changes, with the
  main goal of improving consistency and reducing the number of function args.
- Commit 4 adds UFFDIO_CONTINUE_MODE_WP.

The refactors are sorted by increasing controversial-ness, the idea being we
could drop some of the refactors if they are deemed not worth it.

Changelog:

v4->v5:
 - rename "uffd_flags_has_mode" to "uffd_flags_mode_is"
 - modify "uffd_flags_set_mode" to clear mode bits before setting new mode
 - update userfaultfd documentation to describe new mode flag

v3->v4:
 - massage the uffd_flags_t implementation to eliminate all sparse warnings
 - add a couple inline helpers to make uffd_flags_t usage easier
 - drop the refactor passing `struct uffdio_range *` around (previously 4/5)
 - define a temporary `struct mm_struct *` in function with >=3 `vma->vm_mm`
 - consistent argument order between `flags` and `pagep`
 - expand on the use case in patch 4/4 message

v2->v3:
 - rebase onto 6.3-rc1
 - typedef a new type for mfill flags in patch 3/5 (suggested by Nadav)

v1->v2:
 - refactor before adding the new flag, to avoid perpetuating messiness

Axel Rasmussen (4):
  mm: userfaultfd: rename functions for clarity + consistency
  mm: userfaultfd: don't pass around both mm and vma
  mm: userfaultfd: combine 'mode' and 'wp_copy' arguments
  mm: userfaultfd: add UFFDIO_CONTINUE_MODE_WP to install WP PTEs

 Documentation/admin-guide/mm/userfaultfd.rst |   8 +
 fs/userfaultfd.c                             |  29 ++--
 include/linux/hugetlb.h                      |  27 ++-
 include/linux/shmem_fs.h                     |   9 +-
 include/linux/userfaultfd_k.h                |  69 +++++---
 include/uapi/linux/userfaultfd.h             |   7 +
 mm/hugetlb.c                                 |  28 +--
 mm/shmem.c                                   |  14 +-
 mm/userfaultfd.c                             | 170 +++++++++----------
 tools/testing/selftests/mm/userfaultfd.c     |   4 +
 10 files changed, 196 insertions(+), 169 deletions(-)

--
2.40.0.rc1.284.g88254d51c5-goog



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-14 22:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-14 22:12 [PATCH v5 0/4] mm: userfaultfd: refactor and add UFFDIO_CONTINUE_MODE_WP Axel Rasmussen
2023-03-14 22:12 ` [PATCH v5 1/4] mm: userfaultfd: rename functions for clarity + consistency Axel Rasmussen
2023-03-14 22:12 ` [PATCH v5 2/4] mm: userfaultfd: don't pass around both mm and vma Axel Rasmussen
2023-03-14 22:12 ` [PATCH v5 3/4] mm: userfaultfd: combine 'mode' and 'wp_copy' arguments Axel Rasmussen
2023-03-14 22:12 ` [PATCH v5 4/4] mm: userfaultfd: add UFFDIO_CONTINUE_MODE_WP to install WP PTEs Axel Rasmussen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox