From patchwork Wed Oct 20 21:07:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 12573371 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 879DCC433FE for ; Wed, 20 Oct 2021 21:08:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3C9B0610EA for ; Wed, 20 Oct 2021 21:08:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3C9B0610EA 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 D2F3E94000E; Wed, 20 Oct 2021 17:08:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CDD8A940009; Wed, 20 Oct 2021 17:08:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B0A3F94000E; Wed, 20 Oct 2021 17:08:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0218.hostedemail.com [216.40.44.218]) by kanga.kvack.org (Postfix) with ESMTP id 91B65940009 for ; Wed, 20 Oct 2021 17:08:12 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 442B1181C77C4 for ; Wed, 20 Oct 2021 21:08:12 +0000 (UTC) X-FDA: 78718053624.06.D96A117 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by imf07.hostedemail.com (Postfix) with ESMTP id D9C80100009E for ; Wed, 20 Oct 2021 21:08:15 +0000 (UTC) Received: by mail-pf1-f179.google.com with SMTP id v8so3988609pfu.11 for ; Wed, 20 Oct 2021 14:08:11 -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=LPxj7lozeCH0kLnc2/lpe544PLDdIaniV+hAq9jcw3Y=; b=aaoRyUUDHzIFQzxjETUplwQaxR1W3mqUn0GOKalk/y0EBM61QVOu8EKmRkgltZW3vM BoeTTpuQvgdYas3IWbRYAABxsDMDMxC/BXdKsvuzhRHBTIqTQxrUP1Ri0qxhCihWAeBc ypu7SxlFkJI2950Of9Dp2oDnTKlCDWPIK9V9tuox4tvKmpLaPnXn8ceg/rx6H2qY9I7P X1rTheWtyz54X4mRRcB33yKDNrrxAuRdDJ3C3W9A2ymI9uzF7peyhDvMgfCscYcraBxY /wRoXXLnefUy1RLK60ri7D1bkZ+mMXP/ps9TGn3fZaxjFPBLTnqvdzAnV8oLFHIEfehI GmjA== 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=LPxj7lozeCH0kLnc2/lpe544PLDdIaniV+hAq9jcw3Y=; b=LDq8Wzdoc4N7WJxDI/nFYJ0VmGqmWJg6FUyC4n9nXDGFCLjaU6fsgnVded9Hk4JM42 53DgpjX6reedD9Q4KNvTEGlpNd2u/TVrOKl6i1uePknmH6wHeQbSt/IlMSAe2o4NLPSD SGX/UxVFeFedFo9gRDRBt5y0ZtW6ELEdT3dqEGz1P6Dvk0WpXiLJQ1ayuuyoywl/+s4g v8ux4MZTmiJ7OeVufu52+UbN4twn+HFsCJiJC4k4sDl4Fd9Qg5XA8JHBcLfyDEZLGta3 lvxD7hlAOycLVaCirT1Y357RNv7bN7bCE0FA9B3E06bvx45AXNhbb5VcBJcMR2O5B/g4 +GAA== X-Gm-Message-State: AOAM5303wnNEW3SGfxfYWPkRwXqwLwpE555VKkUF0dQgmHjwMqppBO6U 88Juky0BsqH3XN4ZLeUpOXw= X-Google-Smtp-Source: ABdhPJwJ1bfMEfa0N+uUR9T0CIwfVbfdxBvEBHjDdo9xVZtBYc3GO+RIreIvr1CvuOaFZ8Byfi/9ig== X-Received: by 2002:a63:340c:: with SMTP id b12mr1227283pga.241.1634764091084; Wed, 20 Oct 2021 14:08:11 -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 i8sm3403143pfo.117.2021.10.20.14.08.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Oct 2021 14:08:10 -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: [v5 PATCH 6/6] mm: hwpoison: handle non-anonymous THP correctly Date: Wed, 20 Oct 2021 14:07:55 -0700 Message-Id: <20211020210755.23964-7-shy828301@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20211020210755.23964-1-shy828301@gmail.com> References: <20211020210755.23964-1-shy828301@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: D9C80100009E X-Stat-Signature: 5fftu74rtu9ircjni1aegrze6ugky94h Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=aaoRyUUD; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf07.hostedemail.com: domain of shy828301@gmail.com designates 209.85.210.179 as permitted sender) smtp.mailfrom=shy828301@gmail.com X-Rspamd-Server: rspam01 X-HE-Tag: 1634764095-682898 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. Acked-by: Naoya Horiguchi 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 3603a3acf7b3..bd697c64e973 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; }