]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/blobdiff - mm/rmap.c
hwpoison, hugetlbfs: fix RSS-counter warning
[can-eth-gw-linux.git] / mm / rmap.c
index cf7e99a87c32865c4e6cf5b6ed4f48f7f05aa9e0..face808a489e7765ecbaa57041e4690b47c9d177 100644 (file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1249,12 +1249,14 @@ int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
        update_hiwater_rss(mm);
 
        if (PageHWPoison(page) && !(flags & TTU_IGNORE_HWPOISON)) {
-               if (PageAnon(page))
-                       dec_mm_counter(mm, MM_ANONPAGES);
-               else
-                       dec_mm_counter(mm, MM_FILEPAGES);
+               if (!PageHuge(page)) {
+                       if (PageAnon(page))
+                               dec_mm_counter(mm, MM_ANONPAGES);
+                       else
+                               dec_mm_counter(mm, MM_FILEPAGES);
+               }
                set_pte_at(mm, address, pte,
-                               swp_entry_to_pte(make_hwpoison_entry(page)));
+                          swp_entry_to_pte(make_hwpoison_entry(page)));
        } else if (PageAnon(page)) {
                swp_entry_t entry = { .val = page_private(page) };