]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - mm/mprotect.c
mm: thp: check pmd migration entry in common path
[mirror_ubuntu-bionic-kernel.git] / mm / mprotect.c
index bd0f409922cb2fc133f9fecba64a839380d4f937..a1bfe954577064149468e06e74191a1eeeeae6d0 100644 (file)
@@ -149,7 +149,7 @@ static inline unsigned long change_pmd_range(struct vm_area_struct *vma,
                unsigned long this_pages;
 
                next = pmd_addr_end(addr, end);
-               if (!pmd_trans_huge(*pmd) && !pmd_devmap(*pmd)
+               if (!is_swap_pmd(*pmd) && !pmd_trans_huge(*pmd) && !pmd_devmap(*pmd)
                                && pmd_none_or_clear_bad(pmd))
                        continue;
 
@@ -159,7 +159,7 @@ static inline unsigned long change_pmd_range(struct vm_area_struct *vma,
                        mmu_notifier_invalidate_range_start(mm, mni_start, end);
                }
 
-               if (pmd_trans_huge(*pmd) || pmd_devmap(*pmd)) {
+               if (is_swap_pmd(*pmd) || pmd_trans_huge(*pmd) || pmd_devmap(*pmd)) {
                        if (next - addr != HPAGE_PMD_SIZE) {
                                __split_huge_pmd(vma, pmd, addr, false, NULL);
                        } else {