aboutsummaryrefslogtreecommitdiffstats
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r--mm/hugetlb.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 385c3a1aced7..c2970e7eb527 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -3384,7 +3384,26 @@ unsigned long hugetlb_change_protection(struct vm_area_struct *vma,
3384 spin_unlock(ptl); 3384 spin_unlock(ptl);
3385 continue; 3385 continue;
3386 } 3386 }
3387 if (!huge_pte_none(huge_ptep_get(ptep))) { 3387 pte = huge_ptep_get(ptep);
3388 if (unlikely(is_hugetlb_entry_hwpoisoned(pte))) {
3389 spin_unlock(ptl);
3390 continue;
3391 }
3392 if (unlikely(is_hugetlb_entry_migration(pte))) {
3393 swp_entry_t entry = pte_to_swp_entry(pte);
3394
3395 if (is_write_migration_entry(entry)) {
3396 pte_t newpte;
3397
3398 make_migration_entry_read(&entry);
3399 newpte = swp_entry_to_pte(entry);
3400 set_huge_pte_at(mm, address, ptep, newpte);
3401 pages++;
3402 }
3403 spin_unlock(ptl);
3404 continue;
3405 }
3406 if (!huge_pte_none(pte)) {
3388 pte = huge_ptep_get_and_clear(mm, address, ptep); 3407 pte = huge_ptep_get_and_clear(mm, address, ptep);
3389 pte = pte_mkhuge(huge_pte_modify(pte, newprot)); 3408 pte = pte_mkhuge(huge_pte_modify(pte, newprot));
3390 pte = arch_make_huge_pte(pte, vma, NULL, 0); 3409 pte = arch_make_huge_pte(pte, vma, NULL, 0);