Skip to content

userfaultfd: support access/write hints

Nadav Amit linux-mm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 28 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5userfaultfd: introduce uffd_flagsfs/userfaultfd.c include/linux/hugetlb.h include/linux/shmem_fs.h +4 more+70 -492 replies
2/5userfaultfd: introduce access-likely mode for common operationsfs/userfaultfd.c include/linux/userfaultfd_k.h include/uapi/linux/userfaultfd.h +1 more+52 -1025 replies
3/5userfaultfd: introduce write-likely mode for uffd operationsfs/userfaultfd.c include/linux/userfaultfd_k.h include/uapi/linux/userfaultfd.h +3 more+45 -80 replies
4/5userfaultfd: zero access/write hintsmm/userfaultfd.c+35 -01 reply
5/5selftest/userfaultfd: test read/write hintstools/testing/selftests/vm/run_vmtests.sh tools/testing/selftests/vm/userfaultfd.c+43 -120 replies

Reviews trailers per patch

2 of 5 patches have a Reviewed-by or Acked-by.

PatchDavid HildenbrandPeter Xu
1/5A-b
2/5
3/5
4/5A-b
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH v1 0/5] userfaultfd: support access/write hints

From: Nadav Amit <[email protected]>

Setting the access-bit and dirty-bit introduces a tradeoff. When the bit is set access/write is faster, but memory reclamation might be slower. Currently, in the common userfaultfd cases the access-bit is not set on and the dirty-bit is set. This is a questionable behavior.

Allow userspace to control this behavior through hints access- and write-likely hints. These hints are used to control access- and dirty-bits. For zero-pages that with write-likely hint, allocate a clear page instead of mapping the zero-page.

RFCv2 -> v1:
* Adding hints to zeropage and continue
* Fixing other issues pointed by David H. & Peter Xu
* Adding tests to ./run_vmtests.sh

Cc Mike Kravetz <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Axel Rasmussen <[email protected]>
Cc Peter Xu <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Mike Rapoport <[email protected]>

Nadav Amit (5):
userfaultfd: introduce uffd_flags
userfaultfd: introduce access-likely mode for common operations
userfaultfd: introduce write-likely mode for uffd operations
userfaultfd: zero access/write hints selftest/userfaultfd: test read/write hints

 fs/userfaultfd.c                          |  56 +++++++++--
 include/linux/hugetlb.h                   |   4 +-
 include/linux/shmem_fs.h                  |   8 +-
 include/linux/userfaultfd_k.h             |  26 +++--
 include/uapi/linux/userfaultfd.h          |  31 +++++-
 mm/hugetlb.c                              |   6 +-
 mm/shmem.c                                |   9 +-
 mm/userfaultfd.c                          | 117 ++++++++++++++++------
 tools/testing/selftests/vm/run_vmtests.sh |  23 ++---
 tools/testing/selftests/vm/userfaultfd.c  |  32 ++++++
 10 files changed, 239 insertions(+), 73 deletions(-)
Signature · 1 line
2.25.1