From patchwork Thu Feb 10 14:17:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12741987 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90A00C433EF for ; Thu, 10 Feb 2022 14:21:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E1A3C6B007D; Thu, 10 Feb 2022 09:21:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A83776B007B; Thu, 10 Feb 2022 09:21:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7E08A6B0075; Thu, 10 Feb 2022 09:21:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 5814A6B007D for ; Thu, 10 Feb 2022 09:21:23 -0500 (EST) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 179A6180AD837 for ; Thu, 10 Feb 2022 14:21:23 +0000 (UTC) X-FDA: 79127082846.31.C9A2164 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf22.hostedemail.com (Postfix) with ESMTP id 2FC89C000A for ; Thu, 10 Feb 2022 14:21:22 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Jvf3Z4My2zdZW7; Thu, 10 Feb 2022 22:18:02 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 10 Feb 2022 22:21:15 +0800 From: Miaohe Lin To: , CC: , , Subject: [PATCH 4/8] mm/memory-failure.c: remove unneeded orig_head Date: Thu, 10 Feb 2022 22:17:29 +0800 Message-ID: <20220210141733.1908-5-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220210141733.1908-1-linmiaohe@huawei.com> References: <20220210141733.1908-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected Authentication-Results: imf22.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf22.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 2FC89C000A X-Stat-Signature: 7bjzsiqrmzwijq5ghmwgij9qc98k6nqf X-HE-Tag: 1644502882-537432 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: orig_head is used to check whether the page have changed compound pages during the locking. But it's always equal to hpage. So we can use hpage directly and remove this redundant one. Signed-off-by: Miaohe Lin --- mm/memory-failure.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 2dd7f35ee65a..4370c2f407c5 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1691,7 +1691,6 @@ int memory_failure(unsigned long pfn, int flags) { struct page *p; struct page *hpage; - struct page *orig_head; struct dev_pagemap *pgmap; int res = 0; unsigned long page_flags; @@ -1737,7 +1736,7 @@ int memory_failure(unsigned long pfn, int flags) goto unlock_mutex; } - orig_head = hpage = compound_head(p); + hpage = compound_head(p); num_poisoned_pages_inc(); /* @@ -1821,7 +1820,7 @@ int memory_failure(unsigned long pfn, int flags) * The page could have changed compound pages during the locking. * If this happens just bail out. */ - if (PageCompound(p) && compound_head(p) != orig_head) { + if (PageCompound(p) && compound_head(p) != hpage) { action_result(pfn, MF_MSG_DIFFERENT_COMPOUND, MF_IGNORED); res = -EBUSY; goto unlock_page;