Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756030AbbHGHuU (ORCPT ); Fri, 7 Aug 2015 03:50:20 -0400 Received: from TYO201.gate.nec.co.jp ([210.143.35.51]:36851 "EHLO tyo201.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753060AbbHGHuR convert rfc822-to-8bit (ORCPT ); Fri, 7 Aug 2015 03:50:17 -0400 From: Naoya Horiguchi To: Wanpeng Li CC: Andrew Morton , Andi Kleen , Tony Luck , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" Subject: Re: [PATCH] mm/hwpoison: fix page refcount of unkown non LRU page Thread-Topic: [PATCH] mm/hwpoison: fix page refcount of unkown non LRU page Thread-Index: AQHQ0B9x9whhENzdrUSa/PdnbtKhV53/kyQA Date: Fri, 7 Aug 2015 07:46:13 +0000 Message-ID: <20150807074612.GA8014@hori1.linux.bs1.fc.nec.co.jp> References: In-Reply-To: Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.128.101.10] Content-Type: text/plain; charset="iso-2022-jp" Content-ID: <705AE040ABD8B04C9959EE9CE33FFDD6@gisp.nec.co.jp> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1960 Lines: 53 On Thu, Aug 06, 2015 at 04:09:37PM +0800, Wanpeng Li wrote: > 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(). > > Signed-off-by: Wanpeng Li This fix is correct. Thanks you for catching this, Wanpeng! Acked-by: Naoya Horiguchi BTW, I think this patch is worth sending to stable tree. It seems that the latest change around this code is given by the following commit: commit af8fae7c08862bb85c5cf445bf9b36314b82111f Author: Naoya Horiguchi Date: Fri Feb 22 16:34:03 2013 -0800 mm/memory-failure.c: clean up soft_offline_page() . I think that this bug existed before this commit, but this patch is cleanly applicable only after this patch, so I think tagging "Cc: stable@vger.kernel.org # 3.9+" is good. Thanks, Naoya Horiguchi > --- > 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/