Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp469341pxp; Wed, 16 Mar 2022 09:19:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwHM7SM5LelYkZcCWMY9Goy/xHhL6MGK+vjITC4ldeITWCa/iWMTG1bt8U1MwZnGFA/OK9 X-Received: by 2002:a05:6402:26d3:b0:418:d202:d5dc with SMTP id x19-20020a05640226d300b00418d202d5dcmr295042edd.138.1647447559855; Wed, 16 Mar 2022 09:19:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647447559; cv=none; d=google.com; s=arc-20160816; b=PeqqWik/PgXEbq1xanGUISaEIeSZNgzsZ3B5KU6qFpM4MJYWsripellD2W6LlfyeuH zEFx0g2EEmVpifrgicw9O3zcOH2AqSpmazU0bWx2DFzmx39LiEP5lRhvLbyfiKYHz9Xg MsduODCvNa9nSu43kiWPlwKZx1EvQ8YeAOzxIqERLE9dBvlRxwzLmR+nAmluihHW9lyE 7Mi3hjwVmxHIVyxdiTvhNprrnFFKR0nmsH3z6katdl3VMIsrjckSj0MB4VrC4TmRP1E3 kTEQcN/SWgst7KBT94z+xdKjjFLATGuOvnSPON9hxXmGaBxiKDyzlO9SJjUjGkBgZWTT hKIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=j/wLPs3SB5dHhWSk9ysxLAJNm4g83dZ+ps+bT/CTiD0=; b=CCVVyPTig+d8U0QdZPnHtnewKY96wEjyFLIT9n3S1jUQGR/Z3uBLyXZBBm9PfxQd9+ UKEenjNiHXo71ScSK+T89eMYBvdPGwGMVl8UT4EMJJwxNdmp81aa9+MULOioYVRhCu2E 4Uv5iJHjrW1SnNiJHjC22mtM/JorVXuPlwP5J+GP5queyVVFM5ldhZgwnT9cS7nxG6Vl I43YKiIsjC50fKehexRdIUlFot57G7NkZ5HReyG37w8f4MixD4rRHfppQV1LMuAprvS9 3IhleSauCkRngY+KXRoWWgQJ1CgeXgUPjGE5nY+XdEWudM+dfSLt8qxq0Mv+KwAjvZ5F xZpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j2-20020aa7de82000000b00403c81e356bsi1483946edv.463.2022.03.16.09.18.54; Wed, 16 Mar 2022 09:19:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353413AbiCPDBK (ORCPT + 99 others); Tue, 15 Mar 2022 23:01:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233363AbiCPDBI (ORCPT ); Tue, 15 Mar 2022 23:01:08 -0400 Received: from out199-10.us.a.mail.aliyun.com (out199-10.us.a.mail.aliyun.com [47.90.199.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 707365D669; Tue, 15 Mar 2022 19:59:54 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R631e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04407;MF=xianting.tian@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0V7KZLHo_1647399589; Received: from localhost(mailfrom:xianting.tian@linux.alibaba.com fp:SMTPD_---0V7KZLHo_1647399589) by smtp.aliyun-inc.com(127.0.0.1); Wed, 16 Mar 2022 10:59:50 +0800 From: Xianting Tian To: adobriyan@gmail.com, shy828301@gmail.com, sashal@kernel.org, akpm@linux-foundation.org, linmiaohe@huawei.com Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Xianting Tian Subject: [PATCH] mm: proc: remove redundant page validation of pte_page Date: Wed, 16 Mar 2022 10:59:47 +0800 Message-Id: <20220316025947.328276-1-xianting.tian@linux.alibaba.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pte_page() always returns a valid page, so remove the redundant page validation, as we did in many other places. Signed-off-by: Xianting Tian --- fs/proc/task_mmu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index f46060eb9..a843d13e2 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -1873,8 +1873,6 @@ static int gather_hugetlb_stats(pte_t *pte, unsigned long hmask, return 0; page = pte_page(huge_pte); - if (!page) - return 0; md = walk->private; gather_stats(page, md, pte_dirty(huge_pte), 1); -- 2.17.1