From patchwork Fri Nov 3 14:01:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 161309 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1055828vqu; Fri, 3 Nov 2023 07:04:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFkVzgvXJHx5jm38RuvkimaM+RjAV0xoFJHLsaT5TEgljh1KoYU6Yz7zm5bOwNjODNAPaeJ X-Received: by 2002:a17:903:2351:b0:1cc:37b9:4953 with SMTP id c17-20020a170903235100b001cc37b94953mr18244545plh.67.1699020264283; Fri, 03 Nov 2023 07:04:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699020264; cv=none; d=google.com; s=arc-20160816; b=k5rG44kwsxMuZBrKfiACgZx3ps2PhmGWy6OobLEvehb1VH51jakqw2nxjbmPcE9alV FvKae685NQE1qHBj3ERrB16omE2lSI8DfuU5LAx/xkwwnXSf85CHLQXP6Q56XZO07/PU B6J3rV3i/LNihx1nRHkvCnWV6btMQNJHin+aZVtJhi3y1Bo3yyQHgYh7O8C4HFJUHfcl MhTX76fFCiOzMYERNNNCaNymGilRvYVw7Je5zrDnMOMyWJyAPa20mYuhzqKCswGBSetT 35QmaSuRs3jTHa+0cFvLwyeZkP0tH+nLI8W9OombmJ63pDNvkx3pNSfGHVbxq9gvWnzI 4sFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=etASjzJe50wrJU9UBMk5yCoyKqr7D2lHehFpSzts/t8=; fh=kUj/5waaepfljbNx30rj2BALdV0u/mUCTaFWThlgquQ=; b=xZLkGZQwiYgR5SW7cNVzoTcRIpw0T2dTmGyxfbbQQLeXPlh0EqyjmaBuA2Pj1iHIHV e4rFSwKhnkbFTwFWCN9a/eDT5ckc61MWTJBHDbX9v0vjAnzk15VRc6jjSjp5xj91S65w rVzXtc0kLcpQSzJd48aH+R86jEKUm33NhvHAigDywZa8D1MUj6R1zWs8IfAWR50T2v8l RXTXCqPSwMYUAmi5zGL1SET/U78hbacK0uThW+KlOFMGEZzP4YvGfK3QRS/N/ixCKVom kSM4vHlbEkVEFm/kmLNvd2P7yBCdb3C/ed1OJZQXzvAIIuFyugoM/6/pIXBeN6x9wdb7 w8QQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id h7-20020a170902f7c700b001c60de17b5esi1537724plw.118.2023.11.03.07.04.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 07:04:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 78E7582CB52D; Fri, 3 Nov 2023 07:04:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377872AbjKCOEE (ORCPT + 36 others); Fri, 3 Nov 2023 10:04:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377809AbjKCODz (ORCPT ); Fri, 3 Nov 2023 10:03:55 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4493BD57; Fri, 3 Nov 2023 07:03:51 -0700 (PDT) Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4SMMpQ084Pz1P7nW; Fri, 3 Nov 2023 22:00:46 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Fri, 3 Nov 2023 22:03:47 +0800 From: Kefeng Wang To: Andrew Morton CC: , , Matthew Wilcox , David Hildenbrand , , Kefeng Wang Subject: [PATCH 10/18] mm: memory: use mm_counter_file_folio() in copy_present_pte() Date: Fri, 3 Nov 2023 22:01:11 +0800 Message-ID: <20231103140119.2306578-11-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20231103140119.2306578-1-wangkefeng.wang@huawei.com> References: <20231103140119.2306578-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 03 Nov 2023 07:04:10 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781551872407132623 X-GMAIL-MSGID: 1781551872407132623 Use mm_counter_file_folio() to save one compound_head() call. Signed-off-by: Kefeng Wang --- mm/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory.c b/mm/memory.c index 09009094a5f2..d35ca499bf1c 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -960,7 +960,7 @@ copy_present_pte(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma, } else if (page) { folio_get(folio); page_dup_file_rmap(page, false); - rss[mm_counter_file(page)]++; + rss[mm_counter_file_folio(folio)]++; } /*