From patchwork Thu Sep 23 03:28:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 12511953 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A40CC433F5 for ; Thu, 23 Sep 2021 03:28:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2841D60F48 for ; Thu, 23 Sep 2021 03:28:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2841D60F48 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 BDFBE94000B; Wed, 22 Sep 2021 23:28:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A06BA940007; Wed, 22 Sep 2021 23:28:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 80DF594000B; Wed, 22 Sep 2021 23:28:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0039.hostedemail.com [216.40.44.39]) by kanga.kvack.org (Postfix) with ESMTP id 671E4940007 for ; Wed, 22 Sep 2021 23:28:58 -0400 (EDT) Received: from smtpin33.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 1BC4A2DD75 for ; Thu, 23 Sep 2021 03:28:58 +0000 (UTC) X-FDA: 78617406756.33.3517D43 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by imf06.hostedemail.com (Postfix) with ESMTP id D2CBA801A89C for ; Thu, 23 Sep 2021 03:28:57 +0000 (UTC) Received: by mail-pl1-f182.google.com with SMTP id y1so3089519plk.10 for ; Wed, 22 Sep 2021 20:28:57 -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=mufzV1rPs7RSEi7IGGVM9toNzAQChP8eST1zCDl+0j0=; b=a3H/PjnC3mHIrU/Dz1HjgLY8ZABe/dn5M0rM4dKdgaq8xHbRoQbRVN4Y+/prn4VQ6G bziLsmnaZCxzFY//q7wpnL6BHO4KtLQ/DO26CDOfbGir8Ujr9jy31E+1xBesSpGk9f/U Hy8K5PF5FuAPn4RHdvQY35SZexZ7NBWMhNtb+N+5QAckXNd8/a0QIewQ5SObeTSqOEH7 zC41oz2uvZRBDKZSbaRLuu/ygh+DcjXqpWP2bq9UeYdR1UDctpUeoIn945q+jOMDN9+3 +ObIc+P7IAslbSVK4+dFUXY/GcdoA+JOLNDwIhVj3PxBh6fmk4Tt1vNT0hqA4j0Ckc7v F7VQ== 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=mufzV1rPs7RSEi7IGGVM9toNzAQChP8eST1zCDl+0j0=; b=eoYdkBKvWmN8Q6oeKzsSJV4LLdW3Qu7g/jC9jp6htgEVgGHZ8WXmNsyEggf9N5E30m 6ysTaRSLcyL6jv50RvUJPjxoJD3QZ4oPCabxfs9Fful/NVwhuRhjJnTajPz215Z+I/st y05LyRWMlQcO4ig362sApnmZEGc5yU4rFs21Lh/KF+l0G8djZ/eTJHhTXaIHGM8XoxOn OdqDGeXzVvX6UxqtVbvroYrJXd9jpoHrCncsecHxU7d68BEq6Jjbfu6EYSrzEv3+Uokc eyu+tgys2ka2PlRdSHEblQl/jTC+0UqRNhMRAdkSVopOu3JdrW76LxUl5POXRgbiJPXF oRWA== X-Gm-Message-State: AOAM531cgdB3w9mApnkduQB7oQlUH5GGchvHwVz0DqPOzYtCtJL6oQbt tQNUzSxlNR2UP2i6MCZZ9nM= X-Google-Smtp-Source: ABdhPJxE/7FYG7IJ37yN6cBJHRQo7cXfobkaQIfJsJ6JoHQKPSdWaAqhKADJ29U4rK2ujWoua3VnuA== X-Received: by 2002:a17:90a:ac05:: with SMTP id o5mr15334262pjq.205.1632367737057; Wed, 22 Sep 2021 20:28:57 -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 x8sm3699696pfq.131.2021.09.22.20.28.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Sep 2021 20:28:56 -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: [v2 PATCH 5/5] mm: hwpoison: handle non-anonymous THP correctly Date: Wed, 22 Sep 2021 20:28:30 -0700 Message-Id: <20210923032830.314328-6-shy828301@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210923032830.314328-1-shy828301@gmail.com> References: <20210923032830.314328-1-shy828301@gmail.com> MIME-Version: 1.0 X-Stat-Signature: nxysdutwukomrssi9fgftfsnq7pcchan Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="a3H/PjnC"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf06.hostedemail.com: domain of shy828301@gmail.com designates 209.85.214.182 as permitted sender) smtp.mailfrom=shy828301@gmail.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: D2CBA801A89C X-HE-Tag: 1632367737-437136 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 --- 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 3824bc708e55..e60224b3a315 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1443,14 +1443,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; }