From 590db0e7ae9f267de29af23abd19be24d5c941ad Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Wed, 16 Sep 2009 11:50:11 +0200 Subject: [PATCH] --- yaml --- r: 165730 b: refs/heads/master c: 888b9f7c58ebe8303bad817cd554df887a683957 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/rmap.h | 1 + trunk/mm/rmap.c | 9 ++++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 68cefac64d55..564bbde0e249 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 14fa31b89c5ae79e4131da41761378a6df674352 +refs/heads/master: 888b9f7c58ebe8303bad817cd554df887a683957 diff --git a/trunk/include/linux/rmap.h b/trunk/include/linux/rmap.h index 4c4a2d4d289e..ce989f1fc2ed 100644 --- a/trunk/include/linux/rmap.h +++ b/trunk/include/linux/rmap.h @@ -93,6 +93,7 @@ enum ttu_flags { TTU_IGNORE_MLOCK = (1 << 8), /* ignore mlock */ TTU_IGNORE_ACCESS = (1 << 9), /* don't age */ + TTU_IGNORE_HWPOISON = (1 << 10),/* corrupted page is recoverable */ }; #define TTU_ACTION(x) ((x) & TTU_ACTION_MASK) diff --git a/trunk/mm/rmap.c b/trunk/mm/rmap.c index 08c112a776a7..7e72ca19d68b 100644 --- a/trunk/mm/rmap.c +++ b/trunk/mm/rmap.c @@ -820,7 +820,14 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma, /* Update high watermark before we lower rss */ update_hiwater_rss(mm); - if (PageAnon(page)) { + if (PageHWPoison(page) && !(flags & TTU_IGNORE_HWPOISON)) { + if (PageAnon(page)) + dec_mm_counter(mm, anon_rss); + else + dec_mm_counter(mm, file_rss); + set_pte_at(mm, address, pte, + swp_entry_to_pte(make_hwpoison_entry(page))); + } else if (PageAnon(page)) { swp_entry_t entry = { .val = page_private(page) }; if (PageSwapCache(page)) {