userfaultfd: shmem: wire up shmem_mfill_zeropage_pte
Subsystems (2)
[email protected]
maintainerPATCH 82/119 userfaultfd: shmem: wire up shmem_mfill_zeropage_pte
From: Mike Rapoport <[email protected]>
Subject: userfaultfd: shmem: wire up shmem_mfill_zeropage_pte
For shmem VMAs we can use shmem_mfill_zeropage_pte for UFFDIO_ZEROPAGE
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]>
---
mm/userfaultfd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
mm/userfaultfd.c renamed from mm/userfaultfd.c~userfaultfd-shmem-wire-up-shmem_mfill_zeropage_pte +4 -2
@@ -389,11 +389,13 @@ static __always_inline ssize_t mfill_ato err =mfill_zeropage_pte (dst_mm, dst_pmd, dst_vma, dst_addr); }else { - err = -EINVAL ;/* if zeropage is true return -EINVAL */ -if (likely (!zeropage)) +if (!zeropage) err =shmem_mcopy_atomic_pte (dst_mm, dst_pmd, dst_vma, dst_addr, src_addr, page); +else + err =shmem_mfill_zeropage_pte (dst_mm, dst_pmd, + dst_vma, dst_addr); }return err;
_