diff options
-rw-r--r-- | include/linux/rmap.h | 1 | ||||
-rw-r--r-- | mm/rmap.c | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 4c4a2d4d289e..ce989f1fc2ed 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -93,6 +93,7 @@ enum ttu_flags { | |||
93 | 93 | ||
94 | TTU_IGNORE_MLOCK = (1 << 8), /* ignore mlock */ | 94 | TTU_IGNORE_MLOCK = (1 << 8), /* ignore mlock */ |
95 | TTU_IGNORE_ACCESS = (1 << 9), /* don't age */ | 95 | TTU_IGNORE_ACCESS = (1 << 9), /* don't age */ |
96 | TTU_IGNORE_HWPOISON = (1 << 10),/* corrupted page is recoverable */ | ||
96 | }; | 97 | }; |
97 | #define TTU_ACTION(x) ((x) & TTU_ACTION_MASK) | 98 | #define TTU_ACTION(x) ((x) & TTU_ACTION_MASK) |
98 | 99 | ||
@@ -820,7 +820,14 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma, | |||
820 | /* Update high watermark before we lower rss */ | 820 | /* Update high watermark before we lower rss */ |
821 | update_hiwater_rss(mm); | 821 | update_hiwater_rss(mm); |
822 | 822 | ||
823 | if (PageAnon(page)) { | 823 | if (PageHWPoison(page) && !(flags & TTU_IGNORE_HWPOISON)) { |
824 | if (PageAnon(page)) | ||
825 | dec_mm_counter(mm, anon_rss); | ||
826 | else | ||
827 | dec_mm_counter(mm, file_rss); | ||
828 | set_pte_at(mm, address, pte, | ||
829 | swp_entry_to_pte(make_hwpoison_entry(page))); | ||
830 | } else if (PageAnon(page)) { | ||
824 | swp_entry_t entry = { .val = page_private(page) }; | 831 | swp_entry_t entry = { .val = page_private(page) }; |
825 | 832 | ||
826 | if (PageSwapCache(page)) { | 833 | if (PageSwapCache(page)) { |