From patchwork Thu Sep 23 03:28:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 12511897 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,URIBL_BLOCKED, 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 681EEC433F5 for ; Thu, 23 Sep 2021 03:28:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 16E5661038 for ; Thu, 23 Sep 2021 03:28:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 16E5661038 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 AF459940009; Wed, 22 Sep 2021 23:28:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A53FB940007; Wed, 22 Sep 2021 23:28:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8A70D940009; Wed, 22 Sep 2021 23:28:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0062.hostedemail.com [216.40.44.62]) by kanga.kvack.org (Postfix) with ESMTP id 7EC50940007 for ; Wed, 22 Sep 2021 23:28:54 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 39F35181B10F5 for ; Thu, 23 Sep 2021 03:28:54 +0000 (UTC) X-FDA: 78617406588.05.5160142 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by imf28.hostedemail.com (Postfix) with ESMTP id 0004790000A2 for ; Thu, 23 Sep 2021 03:28:53 +0000 (UTC) Received: by mail-pf1-f176.google.com with SMTP id q23so4437477pfs.9 for ; Wed, 22 Sep 2021 20:28:53 -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=+h8wrTzJZjjfH7tY2yFLH7NP1QBWy5O30wQKxmJymV4=; b=hqmEEybIRSWPPz61v24K2LWGIel7TrmOjaNcxtI5e/qHjYzx5fQUu5S3j2m3tBkf8S 5RGK1kiA9L9skOJDUnmUm8d7qdCFa0TxUQ1eKyizQsHCBzJOsF03YTJ+IMsH643WzDTs f+zDMKkqCAaglYRIj8kaY+bxy51Ht2CteinUWBX5Dkg4946I4P5CYdA/hInySuupCaaE 69sWCyO8FAprMMDVzqDHukw6mlTSZmr4bgdlULHlPjKy5ecKCEO+vlshczdwXgrSbHOB 02zxr70/2OVkZPtKmMBDSoHMg5XbMcguhQJyLskjCQ69DQLvzE33zX6w3ZDX0R82nxVA lZJA== 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=+h8wrTzJZjjfH7tY2yFLH7NP1QBWy5O30wQKxmJymV4=; b=aIkB8Kn+79YGNZ0cb/gHj+Djw51+yru4K5s+CQ/Dm2WOfiAhT3lZlwz2FzfU2vIi2X SeDQzsZWUQ4vk05YZHvhrhca9ZerTjSZqIrVb48wMBHE5NgcSz1eZglo3atDJO39TROZ nsUTu1DAy64RZJkFwiphXCfLQ4W61e0hmMabne2ygLBBZ9h6CqWv9LSteZYhXbSFxL3A Ka6eYy2PgAMddx6bF3pCfGcfy88L9pvCJNxYg7k17etHNdVaNJO5O8KD9vrVzq2ANew3 WozaGVQXngp/rHvEQZltAXoABzB9xfEmq0RNUHkJNAWpjZF9WYsPt6nsPcxYfOC4Z+kd Ga8w== X-Gm-Message-State: AOAM5306zGlkHV9kqzdmGj6kOjM/OwdccZNVyFcbAZHoQ7Dn3HSt4t86 QSCTVo+1Jx8O4SOj6uaJRHg= X-Google-Smtp-Source: ABdhPJzRlD1d9wNX1dSsFHR58krR8pQ+R+DP9Tv6lP9bp/AFperRcrMpoeFxbYWZgtGuQ8YtnkEkRw== X-Received: by 2002:a62:6246:0:b0:443:852a:2a2e with SMTP id w67-20020a626246000000b00443852a2a2emr2113311pfb.14.1632367733052; Wed, 22 Sep 2021 20:28:53 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Sep 2021 20:28:52 -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 3/5] mm: hwpoison: remove the unnecessary THP check Date: Wed, 22 Sep 2021 20:28:28 -0700 Message-Id: <20210923032830.314328-4-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-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 0004790000A2 Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=hqmEEybI; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf28.hostedemail.com: domain of shy828301@gmail.com designates 209.85.210.176 as permitted sender) smtp.mailfrom=shy828301@gmail.com X-Stat-Signature: btix1f3timioc8cyjymumm3gqsscypbu X-HE-Tag: 1632367733-172232 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: When handling THP hwpoison checked if the THP is in allocation or free stage since hwpoison may mistreat it as hugetlb page. After commit 415c64c1453a ("mm/memory-failure: split thp earlier in memory error handling") the problem has been fixed, so this check is no longer needed. Remove it. The side effect of the removal is hwpoison may report unsplit THP instead of unknown error for shmem THP. It seems not like a big deal. Suggested-by: Naoya Horiguchi Signed-off-by: Yang Shi --- mm/memory-failure.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 7722197b2b9d..5c7f1c2aabd9 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1182,20 +1182,6 @@ static int __get_hwpoison_page(struct page *page) if (!HWPoisonHandlable(head)) return -EBUSY; - if (PageTransHuge(head)) { - /* - * Non anonymous thp exists only in allocation/free time. We - * can't handle such a case correctly, so let's give it up. - * This should be better than triggering BUG_ON when kernel - * tries to touch the "partially handled" page. - */ - if (!PageAnon(head)) { - pr_err("Memory failure: %#lx: non anonymous thp\n", - page_to_pfn(page)); - return 0; - } - } - if (get_page_unless_zero(head)) { if (head == compound_head(page)) return 1;