From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DAF72C433F5 for ; Thu, 10 Feb 2022 14:21:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242862AbiBJOVk (ORCPT ); Thu, 10 Feb 2022 09:21:40 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:38552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242832AbiBJOVU (ORCPT ); Thu, 10 Feb 2022 09:21:20 -0500 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7C9B1DC for ; Thu, 10 Feb 2022 06:21:19 -0800 (PST) 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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.23.0