[<prev] [next>] [day] [month] [year] [list]
Message-ID: <BLU436-SMTP25940E686DCAD5372EF47D780730@phx.gbl>
Date: Fri, 7 Aug 2015 18:16:41 +0800
From: Wanpeng Li <wanpeng.li@...mail.com>
To: Andrew Morton <akpm@...ux-foundation.org>
CC: Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
Tony Luck <tony.luck@...el.com>,
Andi Kleen <andi@...stfloor.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, Wanpeng Li <wanpeng.li@...mail.com>,
<stable@...r.kernel.org>
Subject: [PATCH v2 1/2] mm/hwpoison: fix page refcount of unkown non LRU page
After try to drain pages from pagevec/pageset, we try to get reference
count of the page again, however, the reference count of the page is
not reduced if the page is still not on LRU list. This patch fix it by
adding the put_page() to drop the page reference which is from
__get_any_page().
Cc: <stable@...r.kernel.org> # 3.9+
Acked-by: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
Signed-off-by: Wanpeng Li <wanpeng.li@...mail.com>
---
v1 -> v2:
* add Cc stable
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 c53543d..23163d0 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1535,6 +1535,8 @@ static int get_any_page(struct page *page, unsigned long pfn, int flags)
*/
ret = __get_any_page(page, pfn, 0);
if (!PageLRU(page)) {
+ /* Drop page reference which is from __get_any_page() */
+ put_page(page);
pr_info("soft_offline: %#lx: unknown non LRU page type %lx\n",
pfn, page->flags);
return -EIO;
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists