From patchwork Wed Mar 27 15:23:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13606793 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC075C54E67 for ; Wed, 27 Mar 2024 15:24:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 22CAF6B00A6; Wed, 27 Mar 2024 11:24:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1DE006B00A7; Wed, 27 Mar 2024 11:24:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 02EE46B00A9; Wed, 27 Mar 2024 11:24:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id D57FF6B00A6 for ; Wed, 27 Mar 2024 11:24:08 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 9BC8AA12EA for ; Wed, 27 Mar 2024 15:24:08 +0000 (UTC) X-FDA: 81943189776.14.C90D781 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf15.hostedemail.com (Postfix) with ESMTP id 827F5A0012 for ; Wed, 27 Mar 2024 15:24:06 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=aR2vUTXE; spf=pass (imf15.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711553046; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=h7p860Pwfa5oWvGOHiVson4UsvvLX6Zsz0nCOpl6KoI=; b=QYx+peDzb97cLNhqlbYQuxaplzDv5AXa52rMULWaBR3ObnZp7ZAF6Nf/h7W4aPkuYOAYzR jRdCXoQU0kbr8oZU1qlxwhAeoejjNZCjLgL55cLP+cPHjHllytFrnSMqvurccIeRHZYs8i nQrK49htk4l/VvLmjnSR1pTuXr8h/qI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711553046; a=rsa-sha256; cv=none; b=3h/uUcG92naEbZF2/H3MPZs+oMKLN2P3LBuATVDkxcN2rqkaoO0H1ULSeWnyAgxP1X/SJ0 R/G7tiKON4Dc6spM7ax4sOoi2Mw/Bh6LHeV2X+lsB3VHsImStZYU6OEkaHOPy/YfMlnQVY gnr7U7UfJ8EPtjVcVTnuEbSrQmxUbO4= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=aR2vUTXE; spf=pass (imf15.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711553045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h7p860Pwfa5oWvGOHiVson4UsvvLX6Zsz0nCOpl6KoI=; b=aR2vUTXE1JmyVrZPV7R2A9z7VaeQmXL4darXFLG/h8QavsZ8PmT1NEGAvwbMBgo9SjVkhn aumW98T9gkqdrNfMwuDd/q8LdMhJYKgwFQje7hT7JtmfF1ZGCL4/fW9zoxsbDIEKGCgcMy 8jXnbSkWup1j6uoW1RdPDyiUauYpDG0= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-396-sVUPtgWRPpGsibhPgmmQTA-1; Wed, 27 Mar 2024 11:24:01 -0400 X-MC-Unique: sVUPtgWRPpGsibhPgmmQTA-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-69152af7760so25773136d6.1 for ; Wed, 27 Mar 2024 08:24:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711553041; x=1712157841; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h7p860Pwfa5oWvGOHiVson4UsvvLX6Zsz0nCOpl6KoI=; b=oI3FEQepwesORMxGG/KsoCqNRmRspRk8cEdJ64g3SNCPh4p31PBadGQf56hxDCmqsQ +gp+ujgJ3QGzVAv3HKirSxz5jRR+TeN/zM5IoNpo8iUwhQrNKKwh86POPpWskcC5azDM fXgzy4cBJPPZ6SYPy7CodF9rJxUH+ZTSVpRBtWzda3iiCX2VVtevyt7icF409TIXkLNX 1RdQA5q4WoixjJ1S8//QwS4o+9wTt+lLFnmPTOs/qAFv4543lQd7Un/fBlP+DB8RX3Ag ZB78fm9s4iLRZY648AMZEK66ikhk2p5fWf7eaQodPklF4GotINBD5IL8yuXYpbLQD8h2 rnfQ== X-Gm-Message-State: AOJu0YxjuP4Uxts4jNlC31ZtzWBaxk1RzIrwEikEp3OZQhzmz8nqqxL+ 1R6UVoLDjs1rQ3l/czzwo5HV9tvMQ27TOZ58ZFZ/rN6m0TYgdHcJNb29ksppQUauTSIDNXHFrZP r5lUr2xmlpAnec5yS6zZ2YQZFo1kI5cchR2EdGaSyaNwizubE9zCSNza8vLK+aAdoG1cL7Kx4b0 PcNx9Fwye4YhES+B0J+CCXXTn8J3TI4g== X-Received: by 2002:a05:6214:3d13:b0:696:7b12:3744 with SMTP id ol19-20020a0562143d1300b006967b123744mr13941613qvb.0.1711553040447; Wed, 27 Mar 2024 08:24:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGf1gHn7pWGOliI2n3iseJ1Y4KDSmrGTREwaUpEtNei2O8hiTLwONxqZARC/3SfeDcLLHxfTA== X-Received: by 2002:a05:6214:3d13:b0:696:7b12:3744 with SMTP id ol19-20020a0562143d1300b006967b123744mr13941496qvb.0.1711553038757; Wed, 27 Mar 2024 08:23:58 -0700 (PDT) Received: from x1n.redhat.com ([99.254.121.117]) by smtp.gmail.com with ESMTPSA id hu4-20020a056214234400b00690dd47a41csm6412639qvb.86.2024.03.27.08.23.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 08:23:58 -0700 (PDT) From: peterx@redhat.com To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Yang Shi , "Kirill A . Shutemov" , Mike Kravetz , John Hubbard , Michael Ellerman , peterx@redhat.com, Andrew Jones , Muchun Song , linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, Christophe Leroy , Andrew Morton , Christoph Hellwig , Lorenzo Stoakes , Matthew Wilcox , Rik van Riel , linux-arm-kernel@lists.infradead.org, Andrea Arcangeli , David Hildenbrand , "Aneesh Kumar K . V" , Vlastimil Babka , James Houghton , Jason Gunthorpe , Mike Rapoport , Axel Rasmussen Subject: [PATCH v4 11/13] mm/gup: Handle huge pmd for follow_pmd_mask() Date: Wed, 27 Mar 2024 11:23:30 -0400 Message-ID: <20240327152332.950956-12-peterx@redhat.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240327152332.950956-1-peterx@redhat.com> References: <20240327152332.950956-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Rspamd-Queue-Id: 827F5A0012 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: ug9zir6t6pstou36zho1grxjxtwg1e4y X-HE-Tag: 1711553046-766991 X-HE-Meta: U2FsdGVkX183sVqKv7wwex82Yc48rlY0jeaUfZsWrI48/0238JxnwHLBUBQs11upfUBeKHpHS6zkvTg/k8dxRdoQ2OmYw6txm6XEFVnkAF+bbRaGstQ2Op7os8MSQoqAL7rOtKrSJta5rRHJUkflsZhIEhgws+o4n7LeLLIbAmX8gWQEPxEPWwr5g/g2lOVXCpS4O2hiaqIOjekMj5Qawqo9YEOJr7MhnaOgiQ38bRbG1x8/zqX/nFLDMGryxWlzvtXOsMpoavaBQ8SEkb8o/YkBhC8oSKF4t8wv+LUBi1EUb+/6+5P62/GvDzsaAeN/Y0nmiS8krgn8AzHKcJa3LNaRURZsajanDXkSOpFmnd3d/bB6VlP+LQvG252LLYTxiZbkd/bp+83xt623Gd8SbauZZvP6G/Ub+6V4R0GYByJzungoqb3hMu1sMKveTy0BHtYhlBdTZgNYbJnn3HBeCommMGtKZR+/kpXqgtCp6QCZ/UsCEzH5KA5sdPIsFql7AYVIyHA+ivrEtxJijbL5ZpZYs2JJPpsdEN5ndmuM3BlQ5C7UIwTuR2oyjpjIxUIOl2QsNrrht8RfwmDt4GfF4+j27nUwgRIeHTAdjoXUOyOTQBmY8B6Qx4lmDP1qzkjuI1Sca/0hHD6K8rvijN5flCLZJfhWM3TViVhVYCLHn+egkccT2UCXmzst9kf4IH+NsF8qdfekfBCxuYzCQP6kR3jvKq8JkNFuuU1fLr3SSC9irzBsTS4SusVmDQ9k+IuHqrmx0Lbdp1OPKqmY/Ol7NgezsjkS6WmpBeQ6eSElryToYcgM71ELQH7nDXn0OcdFNXwxCoV7wIDC84MSOcenEb5ePgp5wagg9+h1HCrLOj4SbWkJgQCoJEPdQZqiP8c7pOoB+S1abzReFcr1SIaVF9t5Be7aiiAGGHPaVV+eLww9zcWpYE9qMdebUmVkpHFdLDiYGTtsNuTb9P9QJOr WTyuoryL AA7j5UYm7pUx5aNic37oaet2Qvd+sQoHAlQPRqdAtE5HK5fTjiVHn8W7VRFJZgHXjyUfJFtOCkwrWJE965DkEqCmBJ9OECgVSbJrRNFkGiYBOyC7JN05luxwVxAa/BlrwwOe02LiVhgkRbH6yqqIkw3FScFAbzKYiahYt2lY6gXaG/9vGDdyxrfVefFyV/CZyGowOl/q1toDse/z3/AI0nm5OJUvtBsw2LUrqRQGNiWa8/ME454yQS8PvoQwZiI3ttPkdTuP/G3ZaMi0mW/E294z2PC8FbF/BxRteLPGMcJMEUSmf+5mgSipb9Ei/YOj8OO9/z7LXhfsZ373bEM/047B/sEb6H77HCPTKk7x7nZMwaF3DJyku4RksMnVHTERTdHOySA0eeOZe6AXOq3eWq7jcu/FROuw5XoV94usczAckHzrXzKJBp4RYBoCRu0qv9aLxZVu3SK/5WZI= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Peter Xu Replace pmd_trans_huge() with pmd_leaf() to also cover pmd_huge() as long as enabled. FOLL_TOUCH and FOLL_SPLIT_PMD only apply to THP, not yet huge. Since now follow_trans_huge_pmd() can process hugetlb pages, renaming it into follow_huge_pmd() to match what it does. Move it into gup.c so not depend on CONFIG_THP. When at it, move the ctx->page_mask setup into follow_huge_pmd(), only set it when the page is valid. It was not a bug to set it before even if GUP failed (page==NULL), because follow_page_mask() callers always ignores page_mask if so. But doing so makes the code cleaner. Reviewed-by: Jason Gunthorpe Signed-off-by: Peter Xu --- mm/gup.c | 107 ++++++++++++++++++++++++++++++++++++++++++++--- mm/huge_memory.c | 86 +------------------------------------ mm/internal.h | 5 +-- 3 files changed, 105 insertions(+), 93 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index 1e5d42211bb4..a81184b01276 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -580,6 +580,93 @@ static struct page *follow_huge_pud(struct vm_area_struct *vma, return page; } + +/* FOLL_FORCE can write to even unwritable PMDs in COW mappings. */ +static inline bool can_follow_write_pmd(pmd_t pmd, struct page *page, + struct vm_area_struct *vma, + unsigned int flags) +{ + /* If the pmd is writable, we can write to the page. */ + if (pmd_write(pmd)) + return true; + + /* Maybe FOLL_FORCE is set to override it? */ + if (!(flags & FOLL_FORCE)) + return false; + + /* But FOLL_FORCE has no effect on shared mappings */ + if (vma->vm_flags & (VM_MAYSHARE | VM_SHARED)) + return false; + + /* ... or read-only private ones */ + if (!(vma->vm_flags & VM_MAYWRITE)) + return false; + + /* ... or already writable ones that just need to take a write fault */ + if (vma->vm_flags & VM_WRITE) + return false; + + /* + * See can_change_pte_writable(): we broke COW and could map the page + * writable if we have an exclusive anonymous page ... + */ + if (!page || !PageAnon(page) || !PageAnonExclusive(page)) + return false; + + /* ... and a write-fault isn't required for other reasons. */ + if (vma_soft_dirty_enabled(vma) && !pmd_soft_dirty(pmd)) + return false; + return !userfaultfd_huge_pmd_wp(vma, pmd); +} + +static struct page *follow_huge_pmd(struct vm_area_struct *vma, + unsigned long addr, pmd_t *pmd, + unsigned int flags, + struct follow_page_context *ctx) +{ + struct mm_struct *mm = vma->vm_mm; + pmd_t pmdval = *pmd; + struct page *page; + int ret; + + assert_spin_locked(pmd_lockptr(mm, pmd)); + + page = pmd_page(pmdval); + VM_BUG_ON_PAGE(!PageHead(page) && !is_zone_device_page(page), page); + + if ((flags & FOLL_WRITE) && + !can_follow_write_pmd(pmdval, page, vma, flags)) + return NULL; + + /* Avoid dumping huge zero page */ + if ((flags & FOLL_DUMP) && is_huge_zero_pmd(pmdval)) + return ERR_PTR(-EFAULT); + + if (pmd_protnone(*pmd) && !gup_can_follow_protnone(vma, flags)) + return NULL; + + if (!pmd_write(pmdval) && gup_must_unshare(vma, flags, page)) + return ERR_PTR(-EMLINK); + + VM_BUG_ON_PAGE((flags & FOLL_PIN) && PageAnon(page) && + !PageAnonExclusive(page), page); + + ret = try_grab_page(page, flags); + if (ret) + return ERR_PTR(ret); + +#ifdef CONFIG_TRANSPARENT_HUGEPAGE + if (pmd_trans_huge(pmdval) && (flags & FOLL_TOUCH)) + touch_pmd(vma, addr, pmd, flags & FOLL_WRITE); +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ + + page += (addr & ~HPAGE_PMD_MASK) >> PAGE_SHIFT; + ctx->page_mask = HPAGE_PMD_NR - 1; + VM_BUG_ON_PAGE(!PageCompound(page) && !is_zone_device_page(page), page); + + return page; +} + #else /* CONFIG_PGTABLE_HAS_HUGE_LEAVES */ static struct page *follow_huge_pud(struct vm_area_struct *vma, unsigned long addr, pud_t *pudp, @@ -587,6 +674,14 @@ static struct page *follow_huge_pud(struct vm_area_struct *vma, { return NULL; } + +static struct page *follow_huge_pmd(struct vm_area_struct *vma, + unsigned long addr, pmd_t *pmd, + unsigned int flags, + struct follow_page_context *ctx) +{ + return NULL; +} #endif /* CONFIG_PGTABLE_HAS_HUGE_LEAVES */ static int follow_pfn_pte(struct vm_area_struct *vma, unsigned long address, @@ -784,31 +879,31 @@ static struct page *follow_pmd_mask(struct vm_area_struct *vma, return page; return no_page_table(vma, flags, address); } - if (likely(!pmd_trans_huge(pmdval))) + if (likely(!pmd_leaf(pmdval))) return follow_page_pte(vma, address, pmd, flags, &ctx->pgmap); if (pmd_protnone(pmdval) && !gup_can_follow_protnone(vma, flags)) return no_page_table(vma, flags, address); ptl = pmd_lock(mm, pmd); - if (unlikely(!pmd_present(*pmd))) { + pmdval = *pmd; + if (unlikely(!pmd_present(pmdval))) { spin_unlock(ptl); return no_page_table(vma, flags, address); } - if (unlikely(!pmd_trans_huge(*pmd))) { + if (unlikely(!pmd_leaf(pmdval))) { spin_unlock(ptl); return follow_page_pte(vma, address, pmd, flags, &ctx->pgmap); } - if (flags & FOLL_SPLIT_PMD) { + if (pmd_trans_huge(pmdval) && (flags & FOLL_SPLIT_PMD)) { spin_unlock(ptl); split_huge_pmd(vma, pmd, address); /* If pmd was left empty, stuff a page table in there quickly */ return pte_alloc(mm, pmd) ? ERR_PTR(-ENOMEM) : follow_page_pte(vma, address, pmd, flags, &ctx->pgmap); } - page = follow_trans_huge_pmd(vma, address, pmd, flags); + page = follow_huge_pmd(vma, address, pmd, flags, ctx); spin_unlock(ptl); - ctx->page_mask = HPAGE_PMD_NR - 1; return page; } diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 2979198d7b71..ed0d82c4b829 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -1220,8 +1220,8 @@ vm_fault_t vmf_insert_pfn_pud(struct vm_fault *vmf, pfn_t pfn, bool write) EXPORT_SYMBOL_GPL(vmf_insert_pfn_pud); #endif /* CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD */ -static void touch_pmd(struct vm_area_struct *vma, unsigned long addr, - pmd_t *pmd, bool write) +void touch_pmd(struct vm_area_struct *vma, unsigned long addr, + pmd_t *pmd, bool write) { pmd_t _pmd; @@ -1576,88 +1576,6 @@ static inline bool can_change_pmd_writable(struct vm_area_struct *vma, return pmd_dirty(pmd); } -/* FOLL_FORCE can write to even unwritable PMDs in COW mappings. */ -static inline bool can_follow_write_pmd(pmd_t pmd, struct page *page, - struct vm_area_struct *vma, - unsigned int flags) -{ - /* If the pmd is writable, we can write to the page. */ - if (pmd_write(pmd)) - return true; - - /* Maybe FOLL_FORCE is set to override it? */ - if (!(flags & FOLL_FORCE)) - return false; - - /* But FOLL_FORCE has no effect on shared mappings */ - if (vma->vm_flags & (VM_MAYSHARE | VM_SHARED)) - return false; - - /* ... or read-only private ones */ - if (!(vma->vm_flags & VM_MAYWRITE)) - return false; - - /* ... or already writable ones that just need to take a write fault */ - if (vma->vm_flags & VM_WRITE) - return false; - - /* - * See can_change_pte_writable(): we broke COW and could map the page - * writable if we have an exclusive anonymous page ... - */ - if (!page || !PageAnon(page) || !PageAnonExclusive(page)) - return false; - - /* ... and a write-fault isn't required for other reasons. */ - if (vma_soft_dirty_enabled(vma) && !pmd_soft_dirty(pmd)) - return false; - return !userfaultfd_huge_pmd_wp(vma, pmd); -} - -struct page *follow_trans_huge_pmd(struct vm_area_struct *vma, - unsigned long addr, - pmd_t *pmd, - unsigned int flags) -{ - struct mm_struct *mm = vma->vm_mm; - struct page *page; - int ret; - - assert_spin_locked(pmd_lockptr(mm, pmd)); - - page = pmd_page(*pmd); - VM_BUG_ON_PAGE(!PageHead(page) && !is_zone_device_page(page), page); - - if ((flags & FOLL_WRITE) && - !can_follow_write_pmd(*pmd, page, vma, flags)) - return NULL; - - /* Avoid dumping huge zero page */ - if ((flags & FOLL_DUMP) && is_huge_zero_pmd(*pmd)) - return ERR_PTR(-EFAULT); - - if (pmd_protnone(*pmd) && !gup_can_follow_protnone(vma, flags)) - return NULL; - - if (!pmd_write(*pmd) && gup_must_unshare(vma, flags, page)) - return ERR_PTR(-EMLINK); - - VM_BUG_ON_PAGE((flags & FOLL_PIN) && PageAnon(page) && - !PageAnonExclusive(page), page); - - ret = try_grab_page(page, flags); - if (ret) - return ERR_PTR(ret); - - if (flags & FOLL_TOUCH) - touch_pmd(vma, addr, pmd, flags & FOLL_WRITE); - - page += (addr & ~HPAGE_PMD_MASK) >> PAGE_SHIFT; - VM_BUG_ON_PAGE(!PageCompound(page) && !is_zone_device_page(page), page); - - return page; -} - /* NUMA hinting page fault entry point for trans huge pmds */ vm_fault_t do_huge_pmd_numa_page(struct vm_fault *vmf) { diff --git a/mm/internal.h b/mm/internal.h index eee8c82740b5..e10ecc6594f1 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1113,9 +1113,8 @@ int __must_check try_grab_page(struct page *page, unsigned int flags); */ void touch_pud(struct vm_area_struct *vma, unsigned long addr, pud_t *pud, bool write); -struct page *follow_trans_huge_pmd(struct vm_area_struct *vma, - unsigned long addr, pmd_t *pmd, - unsigned int flags); +void touch_pmd(struct vm_area_struct *vma, unsigned long addr, + pmd_t *pmd, bool write); /* * mm/mmap.c