Skip to content
This repository was archived by the owner on Oct 30, 2021. It is now read-only.

Commit 8fb44e5

Browse files
rppttorvalds
authored andcommitted
userfaultfd: shmem: wire up shmem_mfill_zeropage_pte
For shmem VMAs we can use shmem_mfill_zeropage_pte for UFFDIO_ZEROPAGE Link: http://lkml.kernel.org/r/1497939652-16528-6-git-send-email-rppt@linux.vnet.ibm.com Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com> Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Hillf Danton <hillf.zj@alibaba-inc.com> Cc: Hugh Dickins <hughd@google.com> Cc: Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 3217d3c commit 8fb44e5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mm/userfaultfd.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -389,11 +389,13 @@ static __always_inline ssize_t mfill_atomic_pte(struct mm_struct *dst_mm,
389389
err = mfill_zeropage_pte(dst_mm, dst_pmd,
390390
dst_vma, dst_addr);
391391
} else {
392-
err = -EINVAL; /* if zeropage is true return -EINVAL */
393-
if (likely(!zeropage))
392+
if (!zeropage)
394393
err = shmem_mcopy_atomic_pte(dst_mm, dst_pmd,
395394
dst_vma, dst_addr,
396395
src_addr, page);
396+
else
397+
err = shmem_mfill_zeropage_pte(dst_mm, dst_pmd,
398+
dst_vma, dst_addr);
397399
}
398400

399401
return err;

0 commit comments

Comments
 (0)