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

From: Qi Zheng
Date: Wed Nov 10 2021 - 05:56:00 EST


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@xxxxxxxxxxxxx>
---
mm/mremap.c | 1 +
1 file changed, 1 insertion(+)

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);
--
2.11.0