From patchwork Mon Nov 6 15:49:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13447144 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 62D59C4332F for ; Mon, 6 Nov 2023 15:50:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F3C5A8E0005; Mon, 6 Nov 2023 10:50:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EECE78E0001; Mon, 6 Nov 2023 10:50:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DDC178E0005; Mon, 6 Nov 2023 10:50:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id CF0368E0001 for ; Mon, 6 Nov 2023 10:50:51 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id AAABA140703 for ; Mon, 6 Nov 2023 15:50:51 +0000 (UTC) X-FDA: 81427967502.26.3738569 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf24.hostedemail.com (Postfix) with ESMTP id 8E480180032 for ; Mon, 6 Nov 2023 15:50:48 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf24.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1699285850; 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=R1OFK54ZTt1+lbhtEO4snTF+moSHr5i6nFLhH4ythgw=; b=IaMSsUAvsLoncawD3Yr069S0Db3Q4IncK6/NL6QRy6VL00LxLz1Q3AwnZjQDwWxerTc1XF M6oMaWtlHVFoqUceQlUeXZJF1yu0MlIFZ4CcTE1z0TlCnMDKx+BlvOUJhPfUY0PmHSU13v luiJME1w5K1nwagWOa59yDwHQ+ppgLE= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf24.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1699285850; a=rsa-sha256; cv=none; b=PZTKUwJO5oKCcMNhyw+G/MTY3NZTbL5DWC8rj0giyPWM/671yDT/DAKXLnpF4IHSaYc4hd 7SoWue7fFDfYb9FA4aYSmgX9+CkYf/NZkCJcZXxaBEL96EySYf1gYvipflzVdf2AdEhDDY vz0pqTQPTenw2hVx/BiISeVAXbGVrmo= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4SPG1Q1TyzzrTbB; Mon, 6 Nov 2023 23:46:50 +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; Mon, 6 Nov 2023 23:49:58 +0800 From: Kefeng Wang To: Andrew Morton CC: , , Matthew Wilcox , David Hildenbrand , , Kefeng Wang Subject: [PATCH 00/10] mm: convert mm counter to take a folio Date: Mon, 6 Nov 2023 23:49:40 +0800 Message-ID: <20231106154950.3399469-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 8E480180032 X-Stat-Signature: e8etbqs9cuirqe8ywxg5cfqokd9dkan1 X-Rspam-User: X-HE-Tag: 1699285848-210208 X-HE-Meta: U2FsdGVkX194TPVucXGNymURyk0HDuVcO4b+4dmoHotqoOsOiduGkCp/A6/kSrOGwOkyexiqg6RrGhuTZOmI31HuLX7Gij31/JoxjFpNJqeJCLeTk1pd4hb/j00pS7fS+4leyE5m4s5xMWAlHdMn9NEQKIq4GaA2GzSdK+793a6cLROJ3vFYuw5JNkVcqf43IaftEvRcK0fHJ3D8t8fy4j9ocn6kG+mRjRK7gBxw5lhCtoxWN7haCoPh2RBhLZ8lDmwFY07+uI8+ah9AuteOSfoFcY8hCnNWEr8us5oGSAWM+hTehM22GSP0TNeoowLvyV2lsYFfSzTLmbBvt0CZVeoTCzqiKF3pto2Al+EPQEoWQg3F1fL4Jv8udp088Mhpchgl5Kfdp8pIUq56JWXfChdRxLTfHjqgJdNP2EAptcQUaCkLipIP1LKuiPEPOCEC9dT7hPXf5l+UYQ2/ngIGEOSbEc6f07LTIMTda8ANL8haSngam0olTLND1gWdmPEaPMyPd/f2zvTK6tQlzWpasqmdTvmF11xGA5GJMZY2GQhmoCb/ZOLvcI1tRPAC186DF2o48cVjTFxnHnjNpxLqp8pkilNblAf8OJD5VnMJf8c0d0vCtNqlYwWOZGaJH9xhbYQ3m4TsV1VKjXWlAjaILR4QFmjUIha7yAl01mgBl8xfclQzaZSz24XgTvsT0aFBSomxbQQXuxg9i/pVc4EXbldYsLOUHEw7leDrqIVq7Av4fNuqDSRDVXGjE5UelWwh5/2wb5jpEQNhZ1EULoN8JJpaOgAvIspDOLcrrAh9iN9wgm+2BsZ+Gvm5H2x6Wt2r2p30DTt33gzGCFRMeLS+wIqJI98sLHDnrOcUqlorGZfvdqPSm/E3tmJL3QktnO8pHjCRbIgf+1AazrGi5G9pq8SF/ZdQN4aCfb7SughNM0y+9eZ1IdJzJtgs3pW0UGxvb7EQq9mBNO+GP9iT7Xz 2iATpQd1 bJWMAVqW27VD/PGJhIRpNtKx7bn59WhfDw4Z4Lf1zsOwxdD5UKjfSaad2PmeF+bVszjfJwC7RKRp/V9/fIvnyo/E1wg68YaffLJFcYuraggfSIJ2iN1ZgBsOMmZ/U0cAW8gpo1d7ERcNIiS2SnK/IBW2Mtu4+azPFtjKJ 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: Make all mm_counter() and mm_counter_file() callers to use a folio, then convert mm counter functions to take a folio, which saves lots of compound_head() calls. v1: - rename should_zap_page() to should_zap_folio(), per Matthew Wilcox - pass page to page_remove_rmap/page_try_dup_anon_rmap for device private page, per Matthew Wilcox Kefeng Wang (10): mm: swap: introduce pfn_swap_entry_to_folio() s390: pgtable: use a folio in ptep_zap_swap_entry() mm: huge_memory: use a folio in __split_huge_pmd_locked() mm: huge_memory: use a folio in zap_huge_pmd() mm: memory: use a folio in copy_nonpresent_pte() mm: memory: use a folio in zap_pte_range() mm: memory: use a folio in do_set_pmd() mm: memory: use a folio in insert_page_into_pte_locked() mm: convert mm_counter() to take a folio mm: convert mm_counter_file() to take a folio arch/s390/mm/pgtable.c | 4 +- include/linux/mm.h | 12 +++--- include/linux/swapops.h | 13 +++++++ kernel/events/uprobes.c | 2 +- mm/huge_memory.c | 34 +++++++++-------- mm/khugepaged.c | 4 +- mm/memory.c | 81 ++++++++++++++++++++++++----------------- mm/rmap.c | 10 ++--- mm/userfaultfd.c | 2 +- 9 files changed, 96 insertions(+), 66 deletions(-)