Message ID | 20231103140119.2306578-13-wangkefeng.wang@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1055877vqu; Fri, 3 Nov 2023 07:04:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHdFpiDZq12FcsQRTlJ/0PxypeimPeGnsGSuzmHrZIT89YGMunu0zKh4WG+Xkk0rS3c3hr4 X-Received: by 2002:a17:902:cecb:b0:1cc:4ff3:c837 with SMTP id d11-20020a170902cecb00b001cc4ff3c837mr14690344plg.68.1699020266949; Fri, 03 Nov 2023 07:04:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699020266; cv=none; d=google.com; s=arc-20160816; b=i6EnZ7QPGlcJgq1ZEmBcIdCQgip5c4L0sqkQxZWkW8tVBJ6n7dUddioPKL+EZUyydc BDaI1IQt+8+Nh3lnuMjmAG85Q3+z7tD/hISGRdjWHRRA3hV+pR9HGq1vRZxJZCrIZqh6 sr2jd7QBT3RDgaQYYUAKKeHmTKK/Nt2rDSOJIrJH3L8yjAITuUxW0MU5AaveAgy85FU7 DpVkywuQsynwANSu14BxGDPhaKR805Aq4/iAovEN/x3doqoHOKqHQJlna8I0atbYU8J4 faSSYMEYmhSr66xQZnYi1PKNVrh9LpYo3pq5L1u/ml6R9BRzAQq6xXYtxVeKOn3hWsU6 kGsQ== 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=OeTPIw8gaHpYgTEOA5d0ZjkKIpqPK2yWIYgWH1aKTeY=; fh=kUj/5waaepfljbNx30rj2BALdV0u/mUCTaFWThlgquQ=; b=GUtq1N5mh+vwSizK93MG5UnyBKEiVwry8uA3cFvdZl+ixUPfh0XhwK7wMk2Ln+Ac9q f5cfCgppMntFO1WXqeQVlYX3z2dO2OgB0dl+1lx2qNSf76RcS1ClnAxx85sNQ8qOFB5w 0Gj75LXt4c8lu9QUhyG8VAMbWlbw+j4TOK4kHjZj5yL2Xvysk+Xxm7hhGgbcZ3ZJkPno 8DtfuuB2T4Hs/jDiqk5uiwvD267eC9g/BjPhVCnkcmcQ9v+xf4UtKWmxUFTOl+vmdM7t uSEROt2sb4wpHIlgjIBuYk9MNbkqA2CSeNnHf1VmnscErE8qKGaH9rywXsLph6+mfoLN AZdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id lb7-20020a170902fa4700b001c0cbaf6970si1505736plb.501.2023.11.03.07.04.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 07:04:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 74DE882CB52D; Fri, 3 Nov 2023 07:04:25 -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 S1377899AbjKCOEL (ORCPT <rfc822;lhua1029@gmail.com> + 36 others); Fri, 3 Nov 2023 10:04:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377788AbjKCOD6 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 3 Nov 2023 10:03:58 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 791ABD4C; Fri, 3 Nov 2023 07:03:55 -0700 (PDT) Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4SMMpQ0kJMz1P7p6; 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 <wangkefeng.wang@huawei.com> To: Andrew Morton <akpm@linux-foundation.org> CC: <linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>, Matthew Wilcox <willy@infradead.org>, David Hildenbrand <david@redhat.com>, <linux-s390@vger.kernel.org>, Kefeng Wang <wangkefeng.wang@huawei.com> Subject: [PATCH 12/18] mm: memory: use mm_counter_file_folio() in set_pte_range() Date: Fri, 3 Nov 2023 22:01:13 +0800 Message-ID: <20231103140119.2306578-13-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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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: <linux-kernel.vger.kernel.org> 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:25 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781551874986554923 X-GMAIL-MSGID: 1781551874986554923 |
Series |
mm: convert to use folio mm counter
|
|
Commit Message
Kefeng Wang
Nov. 3, 2023, 2:01 p.m. UTC
Use mm_counter_file_folio() to save one compound_head() call in
set_pte_rang().
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
mm/memory.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/memory.c b/mm/memory.c index 661c649afc22..2d90da70a1c8 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4414,7 +4414,7 @@ void set_pte_range(struct vm_fault *vmf, struct folio *folio, folio_add_new_anon_rmap(folio, vma, addr); folio_add_lru_vma(folio, vma); } else { - add_mm_counter(vma->vm_mm, mm_counter_file(page), nr); + add_mm_counter(vma->vm_mm, mm_counter_file_folio(folio), nr); folio_add_file_rmap_range(folio, page, nr, vma, false); } set_ptes(vma->vm_mm, addr, vmf->pte, entry, nr);