From patchwork Fri Sep 24 22:43:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12516953 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81124C4332F for ; Fri, 24 Sep 2021 22:43:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 05716610C7 for ; Fri, 24 Sep 2021 22:43:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 05716610C7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 998F96B0072; Fri, 24 Sep 2021 18:43:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 947D56B0073; Fri, 24 Sep 2021 18:43:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8378C6B0074; Fri, 24 Sep 2021 18:43:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0127.hostedemail.com [216.40.44.127]) by kanga.kvack.org (Postfix) with ESMTP id 762D46B0072 for ; Fri, 24 Sep 2021 18:43:22 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 393CC3A7AE for ; Fri, 24 Sep 2021 22:43:22 +0000 (UTC) X-FDA: 78623944644.17.B2ACED7 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf04.hostedemail.com (Postfix) with ESMTP id E581050000B0 for ; Fri, 24 Sep 2021 22:43:21 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id B8B1261019; Fri, 24 Sep 2021 22:43:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1632523401; bh=EvuUAlpzSYOcprBe/h8oX+QM5LFSXdkN/iEH877IZLQ=; h=Date:From:To:Subject:In-Reply-To:From; b=rQqDKBvc5cnaFSo5KzxDmskaGl6iBMXsjxz7PrSBZxRtfX8ojTjaz2i5Qu+pvQf29 ntYHj3dx17OcGwhgiux9nvRzgAtTFQTunvZgG7YlLvY4rebWC2wC5BjM6ZDnGELOup VM3a/A4vS/C5HPuKPq7XiKiqTvugICZVGBN3JEU0= Date: Fri, 24 Sep 2021 15:43:20 -0700 From: Andrew Morton To: akpm@linux-foundation.org, david@redhat.com, linux-mm@kvack.org, mhocko@suse.com, mike.kravetz@oracle.com, mm-commits@vger.kernel.org, naoya.horiguchi@nec.com, osalvador@suse.de, shy828301@gmail.com, stable@vger.kernel.org, tony.luck@intel.com, torvalds@linux-foundation.org Subject: [patch 01/16] mm, hwpoison: add is_free_buddy_page() in HWPoisonHandlable() Message-ID: <20210924224320.S3vgzdWHO%akpm@linux-foundation.org> In-Reply-To: <20210924154257.1dbf6699ab8d88c0460f924f@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: E581050000B0 X-Stat-Signature: xkgse81sz1iq737b4g3zrcwjht3si1tt Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=rQqDKBvc; dmarc=none; spf=pass (imf04.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-HE-Tag: 1632523401-632974 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Naoya Horiguchi Subject: mm, hwpoison: add is_free_buddy_page() in HWPoisonHandlable() commit fcc00621d88b ("mm/hwpoison: retry with shake_page() for unhandlable pages") changes the return value of __get_hwpoison_page() to retry for transiently unhandlable cases. However, __get_hwpoison_page() currently fails to properly judge buddy pages as handlable, so hard/soft offline for buddy pages always fail as "unhandlable page". This is totally regrettable. So let's add is_free_buddy_page() in HWPoisonHandlable(), so that __get_hwpoison_page() returns different return values between buddy pages and unhandlable pages as intended. Link: https://lkml.kernel.org/r/20210909004131.163221-1-naoya.horiguchi@linux.dev Fixes: fcc00621d88b ("mm/hwpoison: retry with shake_page() for unhandlable pages") Signed-off-by: Naoya Horiguchi Acked-by: David Hildenbrand Reviewed-by: Yang Shi Cc: Tony Luck Cc: Oscar Salvador Cc: Mike Kravetz Cc: Michal Hocko Cc: Signed-off-by: Andrew Morton --- mm/memory-failure.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/memory-failure.c~mm-hwpoison-add-is_free_buddy_page-in-hwpoisonhandlable +++ a/mm/memory-failure.c @@ -1126,7 +1126,7 @@ static int page_action(struct page_state */ static inline bool HWPoisonHandlable(struct page *page) { - return PageLRU(page) || __PageMovable(page); + return PageLRU(page) || __PageMovable(page) || is_free_buddy_page(page); } static int __get_hwpoison_page(struct page *page)