Message ID | 20231103140119.2306578-12-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 j7csp1055766vqu; Fri, 3 Nov 2023 07:04:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHZdOXZS/r1OCLlt/2OD8QrjSNx84DL6vLWkTGSlr+oh7KcLMQrkO41pW2PrlO9Y9wuXMGE X-Received: by 2002:a05:6808:249:b0:3b2:e520:dfce with SMTP id m9-20020a056808024900b003b2e520dfcemr21460475oie.58.1699020260642; Fri, 03 Nov 2023 07:04:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699020260; cv=none; d=google.com; s=arc-20160816; b=AcpOCuvkngG4C18Im7rYjZPn5Zj76nRUDV5GQaxfcmrt0ZIC9p/tX/KV4N8z+c+3nd q+B2DWYFsh7EqQI8JUWjKdwpVJFbSogh3gkS5+Oiuidiw6szdsegW9SpAqO0FQvHpOal gsM47gyhvN/3FtqwAIl62LYAyhrwZ3paDpoaiwN6s4LZZtpGtcKEHnGkPIhR42bCg8MD dARGkfuoOvCix5UlRPaVohCgHFDYjWUtMMS+530UJZzXHzoq1G+MMnDMDMs7d1KZ+Y/i 4Xy5tFuaJMcbPxGc2iTzrUEdgv3kEQi7jcs+wo1Wleya9kn2zWMpKbw/hdev2aZ8MG4S Kiiw== 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=J/rSriB3aflAPXuP/oLdhUT4o9qoZ0PrxLn1lca2smA=; fh=kUj/5waaepfljbNx30rj2BALdV0u/mUCTaFWThlgquQ=; b=vg1lE05+snjjSI9Inldip8w77pWFW70BAQlJ36XQEzfl6TIWMdAAvSYLyxj0+mkQ5N uJPlPDXlRHGLfJXvJgUMNt1xYQRkNtgs7M4BIY+Y3cOZRYlDnbeQm0YDXpeS+Ak7yqUC htRAaA+9Rv20G6qjsR9u2833VPH/P21DIAU5ck96qw6YRAC7S4ZXGk5h/K9H7f1oKusC 9vxkfTgJlDdmP6/aUR/JOuTis5VEs14GxH3SNZ6zWvzPhGrKsitpnjJk69mceyP5eIR/ h8uUN586+e5edXHouX3EcWID26SyE0LnB2BNpRPPFg9tb8e9BnqCDSgO9T94q7ywD33y ekrw== 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 w5-20020a056808140500b003ade71403desi719385oiv.331.2023.11.03.07.04.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 07:04:20 -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 567EA82BB57D; Fri, 3 Nov 2023 07:04:16 -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 S1377886AbjKCOEH (ORCPT <rfc822;lhua1029@gmail.com> + 36 others); Fri, 3 Nov 2023 10:04:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377777AbjKCOD6 (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 54965D48; 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 4SMMpQ0R1Xz1P7pS; 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 11/18] mm: memory: use mm_counter_file_folio() in wp_page_copy() Date: Fri, 3 Nov 2023 22:01:12 +0800 Message-ID: <20231103140119.2306578-12-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:16 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781551868673664460 X-GMAIL-MSGID: 1781551868673664460 |
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.
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 d35ca499bf1c..661c649afc22 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3158,7 +3158,7 @@ static vm_fault_t wp_page_copy(struct vm_fault *vmf) if (likely(vmf->pte && pte_same(ptep_get(vmf->pte), vmf->orig_pte))) { if (old_folio) { if (!folio_test_anon(old_folio)) { - dec_mm_counter(mm, mm_counter_file(&old_folio->page)); + dec_mm_counter(mm, mm_counter_file_folio(old_folio)); inc_mm_counter(mm, MM_ANONPAGES); } } else {