path: root/mm/pgtable-generic.c
diff options
authorAnshuman Khandual <>2020-06-03 16:03:45 -0700
committerLinus Torvalds <>2020-06-03 20:09:49 -0700
commit86ec2da037b85436b63afe3df43ed48fa0e52b0e (patch)
tree0f1bdc8c46237d0a3a75a7366856d8e50bf6e2d3 /mm/pgtable-generic.c
parent124cb3a62d54b271d7acfcf6596cb6a88766a344 (diff)
mm/thp: rename pmd_mknotpresent() as pmd_mkinvalid()
pmd_present() is expected to test positive after pmdp_mknotpresent() as the PMD entry still points to a valid huge page in memory. pmdp_mknotpresent() implies that given PMD entry is just invalidated from MMU perspective while still holding on to pmd_page() referred valid huge page thus also clearing pmd_present() test. This creates the following situation which is counter intuitive. [pmd_present(pmd_mknotpresent(pmd)) = true] This renames pmd_mknotpresent() as pmd_mkinvalid() reflecting the helper's functionality more accurately while changing the above mentioned situation as follows. This does not create any functional change. [pmd_present(pmd_mkinvalid(pmd)) = true] This is not applicable for platforms that define own pmdp_invalidate() via __HAVE_ARCH_PMDP_INVALIDATE. Suggestion for renaming came during a previous discussion here. [ change pmd_mknotvalid() to pmd_mkinvalid() per Will] Link: Suggested-by: Catalin Marinas <> Signed-off-by: Anshuman Khandual <> Signed-off-by: Andrew Morton <> Acked-by: Will Deacon <> Cc: Vineet Gupta <> Cc: Russell King <> Cc: Catalin Marinas <> Cc: Thomas Bogendoerfer <> Cc: Thomas Gleixner <> Cc: Ingo Molnar <> Cc: Borislav Petkov <> Cc: "H. Peter Anvin" <> Cc: Steven Rostedt <> Cc: Dave Hansen <> Cc: Andy Lutomirski <> Cc: Peter Zijlstra <> Cc: Benjamin Herrenschmidt <> Cc: Michael Ellerman <> Cc: Paul Mackerras <> Link: Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'mm/pgtable-generic.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
index 3d7c01e76efc..d18f0e1b6792 100644
--- a/mm/pgtable-generic.c
+++ b/mm/pgtable-generic.c
@@ -194,7 +194,7 @@ pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp)
pmd_t pmdp_invalidate(struct vm_area_struct *vma, unsigned long address,
pmd_t *pmdp)
- pmd_t old = pmdp_establish(vma, address, pmdp, pmd_mknotpresent(*pmdp));
+ pmd_t old = pmdp_establish(vma, address, pmdp, pmd_mkinvalid(*pmdp));
flush_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
return old;