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 X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 5FDDBC433E6 for ; Sat, 13 Mar 2021 10:36:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2D12964F1B for ; Sat, 13 Mar 2021 10:36:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233554AbhCMKdj (ORCPT ); Sat, 13 Mar 2021 05:33:39 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:13167 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233423AbhCMKdL (ORCPT ); Sat, 13 Mar 2021 05:33:11 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DyJqZ36W5zmVq7; Sat, 13 Mar 2021 18:30:50 +0800 (CST) Received: from huawei.com (10.175.104.175) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.498.0; Sat, 13 Mar 2021 18:33:00 +0800 From: Miaohe Lin To: CC: , , , , , , , , , , , , , Subject: [PATCH 4/6] mm/huge_memory.c: remove redundant PageCompound() check Date: Sat, 13 Mar 2021 05:32:23 -0500 Message-ID: <20210313103225.16607-6-linmiaohe@huawei.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20210313103225.16607-1-linmiaohe@huawei.com> References: <20210313103225.16607-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.104.175] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The !PageCompound() check limits the page must be head or tail while !PageHead() further limits it to page head only. So !PageHead() check is equivalent here. Signed-off-by: Miaohe Lin --- mm/huge_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 26f91bf15613..c00205e7c548 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -1291,7 +1291,7 @@ vm_fault_t do_huge_pmd_wp_page(struct vm_fault *vmf, pmd_t orig_pmd) } page = pmd_page(orig_pmd); - VM_BUG_ON_PAGE(!PageCompound(page) || !PageHead(page), page); + VM_BUG_ON_PAGE(!PageHead(page), page); /* Lock page for reuse_swap_page() */ if (!trylock_page(page)) { -- 2.19.1