diff options
author | Andi Kleen <ak@linux.intel.com> | 2009-09-16 05:50:11 -0400 |
---|---|---|
committer | Andi Kleen <ak@linux.intel.com> | 2009-09-16 05:50:11 -0400 |
commit | 888b9f7c58ebe8303bad817cd554df887a683957 (patch) | |
tree | ebd01e55f5a6631a463fbb863adfbe9dcf49ad7d /mm | |
parent | 14fa31b89c5ae79e4131da41761378a6df674352 (diff) |
HWPOISON: Handle hardware poisoned pages in try_to_unmap
When a page has the poison bit set replace the PTE with a poison entry.
This causes the right error handling to be done later when a process runs
into it.
v2: add a new flag to not do that (needed for the memory-failure handler
later) (Fengguang)
v3: remove unnecessary is_migration_entry() test (Fengguang, Minchan)
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
Reviewed-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/rmap.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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)) { |