aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>2012-12-12 16:52:30 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-12 20:38:35 -0500
commit5f24ae585be985691c017b7ab90b3669dca32d6d (patch)
treedac06218e6a4de27c20a63be1845a9a6be400373
parent8c4894c6bc790d0e31e072202939ac6747bbe7ac (diff)
hwpoison, hugetlbfs: fix RSS-counter warning
Memory error handling on hugepages can break a RSS counter, which emits a message like "Bad rss-counter state mm:ffff88040abecac0 idx:1 val:-1". This is because PageAnon returns true for hugepage (this behavior is necessary for reverse mapping to work on hugetlbfs). [akpm@linux-foundation.org: clean up code layout] Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Cc: Andi Kleen <andi.kleen@intel.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Wu Fengguang <fengguang.wu@intel.com> Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/rmap.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/mm/rmap.c b/mm/rmap.c
index cf7e99a87c32..face808a489e 100644
--- 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,
1249 update_hiwater_rss(mm); 1249 update_hiwater_rss(mm);
1250 1250
1251 if (PageHWPoison(page) && !(flags & TTU_IGNORE_HWPOISON)) { 1251 if (PageHWPoison(page) && !(flags & TTU_IGNORE_HWPOISON)) {
1252 if (PageAnon(page)) 1252 if (!PageHuge(page)) {
1253 dec_mm_counter(mm, MM_ANONPAGES); 1253 if (PageAnon(page))
1254 else 1254 dec_mm_counter(mm, MM_ANONPAGES);
1255 dec_mm_counter(mm, MM_FILEPAGES); 1255 else
1256 dec_mm_counter(mm, MM_FILEPAGES);
1257 }
1256 set_pte_at(mm, address, pte, 1258 set_pte_at(mm, address, pte,
1257 swp_entry_to_pte(make_hwpoison_entry(page))); 1259 swp_entry_to_pte(make_hwpoison_entry(page)));
1258 } else if (PageAnon(page)) { 1260 } else if (PageAnon(page)) {
1259 swp_entry_t entry = { .val = page_private(page) }; 1261 swp_entry_t entry = { .val = page_private(page) };
1260 1262