userfaultfd: shmem: add shmem_mfill_zeropage_pte for userfaultfd support
Subsystems (2)
[email protected]
maintainerPATCH 80/119 userfaultfd: shmem: add shmem_mfill_zeropage_pte for userfaultfd support
From: Mike Rapoport <[email protected]>
Subject: userfaultfd: shmem: add shmem_mfill_zeropage_pte for userfaultfd support
shmem_mfill_zeropage_pte is the low level routine that implements the userfaultfd UFFDIO_ZEROPAGE command. Since for shmem mappings zero pages are always allocated and accounted, the new method is a slight extension of the existing shmem_mcopy_atomic_pte.
Signed-off-by Mike Rapoport <[email protected]>
Cc "Kirill A. Shutemov" <[email protected]>
Cc Andrea Arcangeli <[email protected]>
Cc Hillf Danton <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Pavel Emelyanov <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
include/linux/shmem_fs.h | 6 +++ mm/shmem.c | 62 ++++++++++++++++++++++++++----------- 2 files changed, 51 insertions(+), 17 deletions(-)
include/linux/shmem_fs.h renamed from include/linux/shmem_fs.h~userfaultfd-shmem-add-shmem_mfill_zeropage_pte-for-userfaultfd-support +6 -0
@@ -137,9 +137,15 @@ extern int shmem_mcopy_atomic_pte(structunsigned long dst_addr, unsigned long src_addr, struct page **pagep); +extern int shmem_mfill_zeropage_pte (struct mm_struct *dst_mm, +pmd_t *dst_pmd, +struct vm_area_struct *dst_vma, +unsigned long dst_addr);#else #define shmem_mcopy_atomic_pte (dst_mm, dst_pte, dst_vma, dst_addr, \ src_addr, pagep) ({ BUG(); 0; }) +#define shmem_mfill_zeropage_pte (dst_mm, dst_pmd, dst_vma, \ + dst_addr) ({ BUG(); 0; })#endif #endif
mm/shmem.c renamed from mm/shmem.c~userfaultfd-shmem-add-shmem_mfill_zeropage_pte-for-userfaultfd-support +45 -17
80 lines not on this page · raw message
_