mm, thp: fix mlocking THP page with migration enabled
[linux-block.git] / mm / huge_memory.c
index 533f9b00147d267644bcbf98da717329fb07c38f..00704060b7f79242d324af81592b0afc6384ae08 100644 (file)
@@ -2931,7 +2931,7 @@ void remove_migration_pmd(struct page_vma_mapped_walk *pvmw, struct page *new)
        else
                page_add_file_rmap(new, true);
        set_pmd_at(mm, mmun_start, pvmw->pmd, pmde);
-       if (vma->vm_flags & VM_LOCKED)
+       if ((vma->vm_flags & VM_LOCKED) && !PageDoubleMap(new))
                mlock_vma_page(new);
        update_mmu_cache_pmd(vma, address, pvmw->pmd);
 }