mm/gup: check for protnone only if it is a PTE entry
Subsystems (2)
[email protected]
maintainerPATCH 87/124 mm/gup: check for protnone only if it is a PTE entry
From: "Aneesh Kumar K.V" <[email protected]>
Subject: mm/gup: check for protnone only if it is a PTE entry
Do the prot_none/FOLL_NUMA check after we are sure this is a THP pte. Archs can implement prot_none such that it can return true for regular pmd entries.
Signed-off-by Aneesh Kumar K.V <[email protected]>
Cc Rik van Riel <[email protected]>
Cc Mel Gorman <[email protected]>
Cc Hillf Danton <[email protected]>
Cc Kirill A. Shutemov <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
mm/gup.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
mm/gup.c renamed from mm/gup.c~mm-gup-check-for-protnone-only-if-it-is-a-pte-entry +3 -2
@@ -272,8 +272,6 @@ struct page *follow_page_mask(struct vm_return page;return no_page_table (vma, flags); } -if ((flags &FOLL_NUMA ) &&pmd_protnone (*pmd)) -return no_page_table (vma, flags);if (pmd_devmap (*pmd)) { ptl =pmd_lock (mm, pmd); page =follow_devmap_pmd (vma, address, pmd, flags);
@@ -284,6 +282,9 @@ struct page *follow_page_mask(struct vm_if (likely (!pmd_trans_huge (*pmd)))return follow_page_pte (vma, address, pmd, flags); +if ((flags &FOLL_NUMA ) &&pmd_protnone (*pmd)) +return no_page_table (vma, flags); + ptl =pmd_lock (mm, pmd);if (unlikely (!pmd_trans_huge (*pmd))) {spin_unlock (ptl);
_