Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1901902pxb; Wed, 20 Oct 2021 14:13:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxh0Tj2/gdhzm8fM47Upc2NuZQtwgz3JiRqis/NHQg3WkeHAaznepJpy62zPugkYALITsTu X-Received: by 2002:a17:906:cc9b:: with SMTP id oq27mr2121155ejb.17.1634764424998; Wed, 20 Oct 2021 14:13:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634764424; cv=none; d=google.com; s=arc-20160816; b=bUB4bLTnawatc1AaLcmlx8RjHovPzD/jVVxx+wY96Rky3LRq4JrAUpe4uRBLm7bZAH J3qfVNqT39G6+9ePjz960oQ+na7PxgwlqNjXAqo8m8rjqT9QWQg3zckuB/RDvpXYRO1u wLx2y2Td2y3pniET8bEhuDddZHqvrZUFu0fU4eT6Lz18Nh2lqKC/S9mMbKxH5iMpkzlH GO1zo9C8CtMx7++BZ3Hl3/ZnxUWszL1ubQle8BwiuVbwYX2m+3sjl0mpVsf2627w+NVi /Xxl7gBGn+tBnUBbB77n50/Jbp8QSNFS7qzujGPyCBhDigUPsNREqqG+AfsvSez74N6V QrBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LPxj7lozeCH0kLnc2/lpe544PLDdIaniV+hAq9jcw3Y=; b=LlnUeZ2edoDFOshLGPQ40QOuPCJiGDOpoGhM88uT/HKZpKVMQyDcxu4pOnQbOIvBAM lG75ucRwwv4POAj9b+/I97D3sqUDWcgfAdkl4yk1SuPUygEfB5F6XeY1UKQrT2mimrFC R3zOooc+rISvPqNKlwQkpz1AIt/9eyeigHGA+/Lf9jewqXqOOZBRPaqxbv1KIZN/9gQV pt/qMtf+AX9FVwXiOFQf3lYeKS6CZA1DMzq6Z0wquKheJUxayg/LlJse1EdZBQOFT3ha Fe1XwdTukaiaYAqxCFHWsIa2+wwSyHKUaL5SQfHyEOUKltf2qZ8JJK5EU9X/pFtlhmLO 6REQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aaoRyUUD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y89si4182905ede.267.2021.10.20.14.13.21; Wed, 20 Oct 2021 14:13:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aaoRyUUD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231513AbhJTVKe (ORCPT + 99 others); Wed, 20 Oct 2021 17:10:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231358AbhJTVK0 (ORCPT ); Wed, 20 Oct 2021 17:10:26 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7691DC061769; Wed, 20 Oct 2021 14:08:11 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id t184so4054267pfd.0; 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=1B510YasJIutODm9vEMlKFHyu6lWFDu2YZ5hw5ofiIdgLvF+z3yySRSP2R0lSk8iBn KBY2V2B/ibVuWVT3wHSld858nVzIWgUBpQXRILIDpmhhuvn8ZRpNOjKxMTkvXyKGRZer QkAMEoMOU7U9Jq/SeDsThqlqOmEHKRdXDHHPBzNsGg9eB1MNR+5kKevTpoaC9ZyTz367 PsDAOVkTd0JCmrKkKhc1FCyYkTXYi6+yfBm3RkItuYTDb/M+L7OSneZ4lElM6DyrEMWo 3AqpOIfEZoGUBrotg4wWUeRLrTkouHgVjHvl9NYa0Xm//oNa4tlHe9GsgM3ZfOrXu25+ wJ+A== X-Gm-Message-State: AOAM5303EQw0MjLlhUNA7NfDt95SNYiYh/1clC8hrhtAZxeSPX0Zqt6t fDiYt3WZYjM25ylW18MeEbmUoBk0Fe4= 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 2.26.2