]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - mm/rmap.c
mm: rmap: use correct helper when poisoning hugepages
[mirror_ubuntu-bionic-kernel.git] / mm / rmap.c
index 130c238fe38437887d548a1c97df8625cdf0130e..b255743351e5978a44839cc78a94243ad06d452e 100644 (file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1367,15 +1367,18 @@ static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
                update_hiwater_rss(mm);
 
                if (PageHWPoison(page) && !(flags & TTU_IGNORE_HWPOISON)) {
+                       pteval = swp_entry_to_pte(make_hwpoison_entry(subpage));
                        if (PageHuge(page)) {
                                int nr = 1 << compound_order(page);
                                hugetlb_count_sub(nr, mm);
+                               set_huge_swap_pte_at(mm, address,
+                                                    pvmw.pte, pteval,
+                                                    vma_mmu_pagesize(vma));
                        } else {
                                dec_mm_counter(mm, mm_counter(page));
+                               set_pte_at(mm, address, pvmw.pte, pteval);
                        }
 
-                       pteval = swp_entry_to_pte(make_hwpoison_entry(subpage));
-                       set_pte_at(mm, address, pvmw.pte, pteval);
                } else if (pte_unused(pteval)) {
                        /*
                         * The guest indicated that the page content is of no