Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752250AbbHJBGz (ORCPT ); Sun, 9 Aug 2015 21:06:55 -0400 Received: from TYO202.gate.nec.co.jp ([210.143.35.52]:62152 "EHLO tyo202.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751966AbbHJBGx convert rfc822-to-8bit (ORCPT ); Sun, 9 Aug 2015 21:06:53 -0400 From: Naoya Horiguchi To: Wanpeng Li CC: Andrew Morton , Tony Luck , Andi Kleen , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: Re: [PATCH v2 2/2] mm/hwpoison: fix fail isolate hugetlbfs page w/ refcount held Thread-Topic: [PATCH v2 2/2] mm/hwpoison: fix fail isolate hugetlbfs page w/ refcount held Thread-Index: AQHQ0Po0pZvD5rYL9UqOgnD0u2XWrp4D2IcA Date: Mon, 10 Aug 2015 01:05:42 +0000 Message-ID: <20150810010542.GA17762@hori1.linux.bs1.fc.nec.co.jp> References: <1438942602-55614-1-git-send-email-wanpeng.li@hotmail.com> 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.31] Content-Type: text/plain; charset="iso-2022-jp" Content-ID: <3FC5F8B8576CEE4B9616EB349061ED73@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: 1612 Lines: 46 On Fri, Aug 07, 2015 at 06:16:42PM +0800, Wanpeng Li wrote: > Hugetlbfs pages will get a refcount in get_any_page() or madvise_hwpoison() > if soft offline through madvise. The refcount which held by soft offline > path should be released if fail to isolate hugetlbfs pages. This patch fix > it by reducing a refcount for both isolate successfully and failure. > > Cc: # 3.9+ > Signed-off-by: Wanpeng Li Acked-by: Naoya Horiguchi > --- > mm/memory-failure.c | 13 ++++++------- > 1 files changed, 6 insertions(+), 7 deletions(-) > > diff --git a/mm/memory-failure.c b/mm/memory-failure.c > index 001f1ba..8077b1c 100644 > --- a/mm/memory-failure.c > +++ b/mm/memory-failure.c > @@ -1557,13 +1557,12 @@ static int soft_offline_huge_page(struct page *page, int flags) > unlock_page(hpage); > > ret = isolate_huge_page(hpage, &pagelist); > - if (ret) { > - /* > - * get_any_page() and isolate_huge_page() takes a refcount each, > - * so need to drop one here. > - */ > - put_page(hpage); > - } else { > + /* > + * get_any_page() and isolate_huge_page() takes a refcount each, > + * so need to drop one here. > + */ > + put_page(hpage); > + if (!ret) { > pr_info("soft offline: %#lx hugepage failed to isolate\n", pfn); > return -EBUSY; > } > -- > 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/