diff mbox series

[v3,12/15] mm/pte_ref: update the pmd entry in move_normal_pmd()

Message ID 20211110105428.32458-13-zhengqi.arch@bytedance.com (mailing list archive)
State New
Headers show
Series Free user PTE page table pages | expand

Commit Message

Qi Zheng Nov. 10, 2021, 10:54 a.m. UTC
The ->pmd member record the pmd entry that maps the user PTE page
table page. When the pmd entry changes, ->pmd needs to be updated
synchronously.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 mm/mremap.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/mm/mremap.c b/mm/mremap.c
index 088a7a75cb4b..4661cdec79dc 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -278,6 +278,7 @@  static bool move_normal_pmd(struct vm_area_struct *vma, unsigned long old_addr,
 	VM_BUG_ON(!pmd_none(*new_pmd));
 
 	pmd_populate(mm, new_pmd, pmd_pgtable(pmd));
+	pte_update_pmd(pmd, new_pmd);
 	flush_tlb_range(vma, old_addr, old_addr + PMD_SIZE);
 	if (new_ptl != old_ptl)
 		spin_unlock(new_ptl);