From patchwork Thu Sep 30 21:53:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 12529377 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 468C7C433F5 for ; Thu, 30 Sep 2021 21:53:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D94B861994 for ; Thu, 30 Sep 2021 21:53:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D94B861994 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 71BD99400D9; Thu, 30 Sep 2021 17:53:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 62B8E94003A; Thu, 30 Sep 2021 17:53:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4CAB09400D9; Thu, 30 Sep 2021 17:53:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0146.hostedemail.com [216.40.44.146]) by kanga.kvack.org (Postfix) with ESMTP id 3829994003A for ; Thu, 30 Sep 2021 17:53:29 -0400 (EDT) Received: from smtpin36.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id F1E913C7C4 for ; Thu, 30 Sep 2021 21:53:28 +0000 (UTC) X-FDA: 78645591696.36.94BE2F5 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by imf03.hostedemail.com (Postfix) with ESMTP id BE9F830039BF for ; Thu, 30 Sep 2021 21:53:28 +0000 (UTC) Received: by mail-pf1-f172.google.com with SMTP id q23so6187314pfs.9 for ; Thu, 30 Sep 2021 14:53:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J8Io/l9XN5d+My1zgLHEsMOIQE36whO468vLIFQxbEE=; b=ANoJfsQGyxPOv21Ujus8FInXNyo9gJKRfdN9mHZYYMspzN9e+u4HZTFKb8Mr5xb8m5 DrBbPXDmQBDTGo45qi7mcEQuzzy6GWU96fbeby9IczZUGrFMmTG7R6qr9bzE3yvesSvH w1yT3aryV4lCcSw+vpo693h07Dp1X0qgh2qPndaC8ZYZfIBMSp5VlTLVeAFKuTHbqwi4 b0R2Cy2Z9QjwGAf8s3Ul0463UmU3zCIGeNhz5zlvzydbvHIBCD89IIl3BqUG+s3Og+FY KqLqzA/Bl0rL+Cr6UiOuNK/h5POJNxvZc+ZPASqsnn6XQRgFA8jPy3j5fDAeohbpwIb9 3N8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=J8Io/l9XN5d+My1zgLHEsMOIQE36whO468vLIFQxbEE=; b=uiWba3tgjBZBCBQ4/DoBuPCiHJ0Wy7cTHaRJXK+lrY7eb1PZa3thzq8hmCYvZ9wNvz 7RPuuQwcokWIOg3N8opkFuLtXD2SxpEljsJPiNieJ3GiAwl/2Q3NmHxI9wckdFFo7jlz jSgAVM9I9XOkMoE2RUuro3Q/S+gBkCRiMFIyslsxrQhf+yUDyB435L4ws+ojsuSbtlQM lm3JxmAB9LTSfrw0Ss7x1XAQ57D0A+vwaYhOPowBuHLXXi8187yK0h8OQiAlN9nRLkFs b379KoJqJZXXjEKdw8RPpML2HvjnhCzY83dIexPLMbhTzd5Y9alxIAmeb+GOOvlutraK WSBw== X-Gm-Message-State: AOAM533dm8NUUELjT9lF0phig149jFBIIZ4wh5HfQMd5akLsoJ5EXJp5 jfd+nQ20S6SZCrCUrLluHNM= X-Google-Smtp-Source: ABdhPJzmhdjDnYdU4WOSRyEbQBjz17y/lhOpbsBtQ/Uw538tEKw0Phs73G6Y9DttpgyF5zbMMrGyKQ== X-Received: by 2002:a62:6544:0:b0:44b:508b:d05c with SMTP id z65-20020a626544000000b0044b508bd05cmr6698352pfb.56.1633038806584; Thu, 30 Sep 2021 14:53:26 -0700 (PDT) Received: from localhost.localdomain (c-73-93-239-127.hsd1.ca.comcast.net. [73.93.239.127]) by smtp.gmail.com with ESMTPSA id p17sm5647535pjg.54.2021.09.30.14.53.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 14:53:25 -0700 (PDT) From: Yang Shi To: naoya.horiguchi@nec.com, hughd@google.com, kirill.shutemov@linux.intel.com, willy@infradead.org, peterx@redhat.com, osalvador@suse.de, akpm@linux-foundation.org Cc: shy828301@gmail.com, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [v3 PATCH 5/5] mm: hwpoison: handle non-anonymous THP correctly Date: Thu, 30 Sep 2021 14:53:11 -0700 Message-Id: <20210930215311.240774-6-shy828301@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210930215311.240774-1-shy828301@gmail.com> References: <20210930215311.240774-1-shy828301@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: BE9F830039BF X-Stat-Signature: iqhj1afi8go94eyyjjg9gaqra1kuis5e Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=ANoJfsQG; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf03.hostedemail.com: domain of shy828301@gmail.com designates 209.85.210.172 as permitted sender) smtp.mailfrom=shy828301@gmail.com X-HE-Tag: 1633038808-306081 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: Currently hwpoison doesn't handle non-anonymous THP, but since v4.8 THP support for tmpfs and read-only file cache has been added. They could be offlined by split THP, just like anonymous THP. Signed-off-by: Yang Shi Acked-by: Naoya Horiguchi --- mm/memory-failure.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 176883cd080f..88866bf4f4a9 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1447,14 +1447,11 @@ static int identify_page_state(unsigned long pfn, struct page *p, static int try_to_split_thp_page(struct page *page, const char *msg) { lock_page(page); - if (!PageAnon(page) || unlikely(split_huge_page(page))) { + if (unlikely(split_huge_page(page))) { unsigned long pfn = page_to_pfn(page); unlock_page(page); - if (!PageAnon(page)) - pr_info("%s: %#lx: non anonymous thp\n", msg, pfn); - else - pr_info("%s: %#lx: thp split failed\n", msg, pfn); + pr_info("%s: %#lx: thp split failed\n", msg, pfn); put_page(page); return -EBUSY; }