[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1497939652-16528-6-git-send-email-rppt@linux.vnet.ibm.com>
Date: Tue, 20 Jun 2017 09:20:50 +0300
From: Mike Rapoport <rppt@...ux.vnet.ibm.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Andrea Arcangeli <aarcange@...hat.com>,
Hugh Dickins <hughd@...gle.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Hillf Danton <hillf.zj@...baba-inc.com>,
Pavel Emelyanov <xemul@...tuozzo.com>,
linux mm <linux-mm@...ck.org>,
lkml <linux-kernel@...r.kernel.org>,
Mike Rapoport <rppt@...ux.vnet.ibm.com>
Subject: [PATCH 5/7] 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 <rppt@...ux.vnet.ibm.com>
---
mm/userfaultfd.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/mm/userfaultfd.c b/mm/userfaultfd.c
index 48c015c..8119270 100644
--- a/mm/userfaultfd.c
+++ b/mm/userfaultfd.c
@@ -389,11 +389,13 @@ static __always_inline ssize_t mfill_atomic_pte(struct mm_struct *dst_mm,
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;
--
2.7.4
Powered by blists - more mailing lists