Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751836AbbHGJ2Q (ORCPT ); Fri, 7 Aug 2015 05:28:16 -0400 Received: from blu004-omc1s29.hotmail.com ([65.55.116.40]:59338 "EHLO BLU004-OMC1S29.hotmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751069AbbHGJ2N (ORCPT ); Fri, 7 Aug 2015 05:28:13 -0400 X-TMN: [21a0+LxhaMotNyI+6bYm6QSZOLgW14jK] X-Originating-Email: [wanpeng.li@hotmail.com] Message-ID: Subject: Re: [PATCH] mm/hwpoison: fix page refcount of unkown non LRU page To: Naoya Horiguchi References: <20150807074612.GA8014@hori1.linux.bs1.fc.nec.co.jp> CC: Andrew Morton , Andi Kleen , Tony Luck , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" From: Wanpeng Li Date: Fri, 7 Aug 2015 17:28:00 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: <20150807074612.GA8014@hori1.linux.bs1.fc.nec.co.jp> Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 07 Aug 2015 09:28:11.0410 (UTC) FILETIME=[60D75720:01D0D0F3] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2121 Lines: 65 On 8/7/15 3:46 PM, Naoya Horiguchi wrote: > 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 Thanks, :) > > 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. I will add this in v2. Regards, Wanpeng Li > > 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/