mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-01 02:21:16 +00:00
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>
This commit is contained in:
parent
8c4894c6bc
commit
5f24ae585b
1 changed files with 7 additions and 5 deletions
12
mm/rmap.c
12
mm/rmap.c
|
@ -1249,12 +1249,14 @@ int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
|
||||||
update_hiwater_rss(mm);
|
update_hiwater_rss(mm);
|
||||||
|
|
||||||
if (PageHWPoison(page) && !(flags & TTU_IGNORE_HWPOISON)) {
|
if (PageHWPoison(page) && !(flags & TTU_IGNORE_HWPOISON)) {
|
||||||
if (PageAnon(page))
|
if (!PageHuge(page)) {
|
||||||
dec_mm_counter(mm, MM_ANONPAGES);
|
if (PageAnon(page))
|
||||||
else
|
dec_mm_counter(mm, MM_ANONPAGES);
|
||||||
dec_mm_counter(mm, MM_FILEPAGES);
|
else
|
||||||
|
dec_mm_counter(mm, MM_FILEPAGES);
|
||||||
|
}
|
||||||
set_pte_at(mm, address, pte,
|
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)) {
|
} else if (PageAnon(page)) {
|
||||||
swp_entry_t entry = { .val = page_private(page) };
|
swp_entry_t entry = { .val = page_private(page) };
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue