Skip to content

mm/madvise: introduce MADV_POPULATE_(READ|WRITE) to prefault page tables

David Hildenbrand linux-alpha linux-api linux-arch linux-kselftest linux-mips linux-mm linux-parisc lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest posting 2/25 patches 9 repliesIn review
  2. v2 posting 1/25 patches 3 repliesApplied 5/5
  3. v15 patches 10 repliesSuperseded

Changes in v2 from the cover letter

- "mm/madvise: introduce MADV_POPULATE_(READ|WRITE) to prefault page tables"
-- Renamed patch/series to match what's happening -- prefault page tables -- Clarified MADV_POPULATE_READ semantics on file holes and that we might
want fallocate().
-- Updated/clarified description
-- Dropped -EINVAL and -EBUSY checks
-- Added a comment regarding FOLL_TOUCH and why we don't care that
pages will get set dirty when triggering write-faults for now.
-- Reran and extended performance measurements by more fallocate()
combinations

Patches in v2 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5mm: make variable names for populate_vma_page_range() consistentmm/internal.h+1 -12 replies
2/5mm/madvise: introduce MADV_POPULATE_(READ|WRITE) to prefault page tablesarch/alpha/include/uapi/asm/mman.h arch/mips/include/uapi/asm/mman.h arch/parisc/include/uapi/asm/mman.h +5 more+142 -06 replies
3/5MAINTAINERS: add tools/testing/selftests/vm/ to MEMORY MANAGEMENTMAINTAINERS+1 -01 reply
4/5selftests/vm: add protection_keys_32 / protection_keys_64 to gitignoretools/testing/selftests/vm/.gitignore+2 -00 replies
5/5selftests/vm: add test for MADV_POPULATE_(READ|WRITE)tools/testing/selftests/vm/.gitignore tools/testing/selftests/vm/Makefile tools/testing/selftests/vm/madv_populate.c +1 more+360 -00 replies

Reviews trailers per patch

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

PatchMike RapoportOscar Salvador
1/5R-b
2/5
3/5A-b
4/5
5/5

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

Read the v2 thread

Cover letter [PATCH resend v2 0/5] mm/madvise: introduce MADV_POPULATE_(READ|WRITE) to prefault page tables

This is a resend of v2 because linux-mm seems to have swallowed patch #2.

Excessive details on MADV_POPULATE_(READ|WRITE) can be found in patch #2.

v1 -> v2:
- "mm/madvise: introduce MADV_POPULATE_(READ|WRITE) to prefault page tables"
-- Renamed patch/series to match what's happening -- prefault page tables -- Clarified MADV_POPULATE_READ semantics on file holes and that we might
want fallocate().
-- Updated/clarified description
-- Dropped -EINVAL and -EBUSY checks
-- Added a comment regarding FOLL_TOUCH and why we don't care that
pages will get set dirty when triggering write-faults for now.
-- Reran and extended performance measurements by more fallocate()
combinations

RFCv2 -> v1
- "mm: fix variable name in declaration of populate_vma_page_range()" -- Added
- "mm/madvise: introduce MADV_POPULATE_(READ|WRITE) to prefault ..." -- Fix detection of memory holes when we have to re-lookup the VMA -- Return -EHWPOISON to user space when we hit HW poisoned pages -- Make variable names in definition and declaration consistent
- "MAINTAINERS: add tools/testing/selftests/vm/ to MEMORY MANAGEMENT" -- Added
- "selftests/vm: add protection_keys_32 / protection_keys_64 to gitignore" -- Added
- "selftests/vm: add test for MADV_POPULATE_(READ|WRITE)"
-- Added

RFC -> RFCv2:
- Fix re-locking (-> set "locked = 1;")
- Don't mimic MAP_POPULATE semantics:
--> Explicit READ/WRITE request instead of selecting it automatically,
which makes it more generic and better suited for some use cases (e.g., we usually want to prefault shmem writable)
--> Require proper access permissions
- Introduce and use faultin_vma_page_range()
--> Properly handle HWPOISON pages (FOLL_HWPOISON)
--> Require proper access permissions (!FOLL_FORCE)
- Let faultin_vma_page_range() check for compatible mappings/permissions
- Extend patch description and add some performance numbers

David Hildenbrand (5):
mm: make variable names for populate_vma_page_range() consistent mm/madvise: introduce MADV_POPULATE_(READ|WRITE) to prefault page
tables
MAINTAINERS: add tools/testing/selftests/vm/ to MEMORY MANAGEMENT selftests/vm: add protection_keys_32 / protection_keys_64 to gitignore selftests/vm: add test for MADV_POPULATE_(READ|WRITE)

 MAINTAINERS                                |   1 +
 arch/alpha/include/uapi/asm/mman.h         |   3 +
 arch/mips/include/uapi/asm/mman.h          |   3 +
 arch/parisc/include/uapi/asm/mman.h        |   3 +
 arch/xtensa/include/uapi/asm/mman.h        |   3 +
 include/uapi/asm-generic/mman-common.h     |   3 +
 mm/gup.c                                   |  58 ++++
 mm/internal.h                              |   5 +-
 mm/madvise.c                               |  66 ++++
 tools/testing/selftests/vm/.gitignore      |   3 +
 tools/testing/selftests/vm/Makefile        |   1 +
 tools/testing/selftests/vm/madv_populate.c | 342 +++++++++++++++++++++
 tools/testing/selftests/vm/run_vmtests.sh  |  16 +
 13 files changed, 506 insertions(+), 1 deletion(-)
 create mode 100644 tools/testing/selftests/vm/madv_populate.c

base-commit: bf05bf16c76bb44ab5156223e1e58e26dfe30a88

Signature · 1 line
2.30.2