diff options
author | Wanpeng Li <wanpeng.li@hotmail.com> | 2015-09-08 18:03:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-08 18:35:28 -0400 |
commit | 7d1900c744b2e4687b3e467edf58373c02bcf22d (patch) | |
tree | 172e71a73d3b159dc2da1ca1fe344b59a3f5ce2f /mm/memory-failure.c | |
parent | 5dd2c4bded8776ee93c8f38b739fea531095067f (diff) |
mm/hwpoison: fix failure to split thp w/ refcount held
THP pages will get a refcount in madvise_hwpoison() w/
MF_COUNT_INCREASED flag, however, the refcount is still held when fail
to split THP pages.
Fix it by reducing the refcount of THP pages when fail to split THP.
Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memory-failure.c')
-rw-r--r-- | mm/memory-failure.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 016c814101ed..8ad923a93539 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c | |||
@@ -1725,6 +1725,8 @@ int soft_offline_page(struct page *page, int flags) | |||
1725 | if (PageAnon(hpage) && unlikely(split_huge_page(hpage))) { | 1725 | if (PageAnon(hpage) && unlikely(split_huge_page(hpage))) { |
1726 | pr_info("soft offline: %#lx: failed to split THP\n", | 1726 | pr_info("soft offline: %#lx: failed to split THP\n", |
1727 | pfn); | 1727 | pfn); |
1728 | if (flags & MF_COUNT_INCREASED) | ||
1729 | put_page(page); | ||
1728 | return -EBUSY; | 1730 | return -EBUSY; |
1729 | } | 1731 | } |
1730 | } | 1732 | } |