[RFC PATCH v2 30/30] mm: thp: enable anonymous PUD THP at page fault path.

From: Zi Yan
Date: Mon Sep 28 2020 - 14:02:10 EST


From: Zi Yan <ziy@xxxxxxxxxx>

All previous commits have anonymous PUD THP support ready, so we can
enable anonymous PUD THP page fault now.

Signed-off-by: Zi Yan <ziy@xxxxxxxxxx>
---
mm/memory.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/mm/memory.c b/mm/memory.c
index 9f7b509a3aa7..dc285d9872fc 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -4122,16 +4122,15 @@ static vm_fault_t create_huge_pud(struct vm_fault *vmf)
{
#if defined(CONFIG_TRANSPARENT_HUGEPAGE) && \
defined(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD)
- /* No support for anonymous transparent PUD pages yet */
if (vma_is_anonymous(vmf->vma))
- goto split;
+ return do_huge_pud_anonymous_page(vmf);
if (vmf->vma->vm_ops->huge_fault) {
vm_fault_t ret = vmf->vma->vm_ops->huge_fault(vmf, PE_SIZE_PUD);

if (!(ret & VM_FAULT_FALLBACK))
return ret;
}
-split:
+
/* COW or write-notify not handled on PUD level: split pud.*/
__split_huge_pud(vmf->vma, vmf->pud, vmf->address, false, NULL);
#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
--
2.28.0