From patchwork Fri Apr 12 06:47:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13626908 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 769D1C04FF9 for ; Fri, 12 Apr 2024 06:20:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DA6F26B0087; Fri, 12 Apr 2024 02:20:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C9B3C6B0089; Fri, 12 Apr 2024 02:20:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AC6AD6B008A; Fri, 12 Apr 2024 02:20:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 831436B0089 for ; Fri, 12 Apr 2024 02:20:48 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 46AFB1C0FFE for ; Fri, 12 Apr 2024 06:20:48 +0000 (UTC) X-FDA: 81999881376.02.93C9756 Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by imf06.hostedemail.com (Postfix) with ESMTP id 35A54180011 for ; Fri, 12 Apr 2024 06:20:45 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=none; spf=pass (imf06.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.32 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712902846; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=y+gnH/1DykFs2Wwfsw7KgaSFuFZHsAWd8ta3mIsjJ7I=; b=0LLt4xBCxo4Za+0fmTzZvU00jaxRlWdHFjGdbftqvBH6XX6wK5HtPqp0XkUdFdWRmOmt5Z 3kDX7U4LK+hQScC+B5sAAtZHZuAZYolDLAgyY6GvdE3sV6duKp4sPkcCPT1zMmUi+V3hs4 F3XS+8T/KsDCvuT1mXjubNIj2YsEK3I= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; spf=pass (imf06.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.32 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712902846; a=rsa-sha256; cv=none; b=GDZHTX0aZYYA/c5r1/xnWwL2TccGI488eog/up6nlwgGQR1tCdh14aVYQDE2voZf+nyMac H1v+o7EUzUOQncYmXtNj+H+Sv0UgcmdyqKljvppm6YD/jsNWqjgrvOE8SSaPWGco3XTMcU Yy4wULqrZZmhDGmYEGLaJfVWB3V5BcM= Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4VG5y93VYSz1wrM2; Fri, 12 Apr 2024 14:19:45 +0800 (CST) Received: from dggpemm100001.china.huawei.com (unknown [7.185.36.93]) by mail.maildlp.com (Postfix) with ESMTPS id B6A021A0188; Fri, 12 Apr 2024 14:20:41 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 12 Apr 2024 14:20:41 +0800 From: Kefeng Wang To: Andrew Morton CC: "Matthew Wilcox (Oracle)" , , , Kefeng Wang Subject: [PATCH v3 0/2] mm: batch mm counter updating in filemap_map_pages() Date: Fri, 12 Apr 2024 14:47:49 +0800 Message-ID: <20240412064751.119015-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm100001.china.huawei.com (7.185.36.93) X-Rspamd-Queue-Id: 35A54180011 X-Rspam-User: X-Stat-Signature: 7ei4m9r3h3eihrsfkzda3wzh74n4k7hy X-Rspamd-Server: rspam01 X-HE-Tag: 1712902845-508955 X-HE-Meta: U2FsdGVkX1/QXSjO10iSjpyr0u6Li+ImlAT9U2m3qNsb1NqWuD2uU/LXpWIW4Cpo7ArYoXYdG0E9gbh/Iy7RHEz7miP8Q6Ihzyh2Nvka+i0NgBpBWXEz+R2bSzDqcImYxPfSiPgO64k6XGwr5ZDYpplWEljLyAk69rht03eQyHyaqumn/v45bS50p/48ykBUEbA9NKGcS1wOYRwUMt3/MuaoaHoWBVFJX7wNQpUG7qbI8zL7d0dF9ytlbza3BV77HubE8fkx7dD5UYpUatH7agHOFA9eSVivtsQDxQzwhXdLgTj0mT3W/OD4v0nILuVFZVocZpQEBcZxI/fWTW0279Sz8XLup1PGVV50K4FnH0c3zgfcakDMnxm44lOREMuOG23ma6WtbOdoSSKCtyD+s7IXcb0uWi5NMY/oGeyw5RyG/sRbOLCpV92uhTK+ubPHlmPrfBSbioankz4aIfIOVcgZCpnEJSKuh0Z20RKoXQKFfPwtMmS3KY7/B8ZvA4J5He/NLVyr+rOsGSNo2aNcfMNjFfFrPHzLjg+9jkQAylXt1LBC++wskl1hg4jGmXcQGtztL7ffhxkYQ4A2M4jZfmq9FBHY5VMYeut5myXsSlz0V+F5pbziZmIJnPnRCdlJ6VU/t7Mi71WqQlMravO//R1riH9REPTbswtgKNxPRnSRqrL86cu+giWQTNOe+qicFI0Nlo47TRI+wE1mcQaCgyySPlKb9Rzb3QVYO8OfUqFwKywsqEKuAwPWG1tsgTq4IxjXdvfvgn/NQZcqlk02ATeNyHhaLhVwgX+FwdLlqohcz+z87pNO+g8plpTl/peR6wsv0QgQ0pIeGj+HEtkJH6ZMsXS6R5W1vNuKNuDcT1tVfcrM+jjb6s2JLfZsKJM2sglyVKt/mb1XKITFEZJMMxtIDpccGCOc8FXP+09YQgVraQqfGkKTqtpqc7WYsPWWToCLEHyZ6iHKoVNwBHY bUV3mPlI TZc02nLXtXEEshXrkHNL2m+iwVZJyhQ/6PmbfKhTAzLibnVMO0Gt/5/icjsr/bd88iR6DWQ0teiv61UkxXz2FmtuET0d11+nPeKORR1rCtXbk3UB2d7INM23gWCFP2PzhMhpAKTQym3LrI+iXTXJ7GQnH21Z/M8b/mJ0k X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Let's batch mm counter updating to accelerate filemap_map_pages(). v2: - estimate folio type from caller and no need to return from set_pte_range() - use unsigned long for rss v3: - make is_cow to bool in patch1 and fix null folio in patch2 - retest, improvement same with v1 Kefeng Wang (2): mm: move mm counter updating out of set_pte_range() mm: filemap: batch mm counter updating in filemap_map_pages() mm/filemap.c | 17 ++++++++++++----- mm/memory.c | 8 +++++--- 2 files changed, 17 insertions(+), 8 deletions(-)