From patchwork Fri Nov 3 14:01:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13444561 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 B8071C4332F for ; Fri, 3 Nov 2023 14:03:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 323FE28001C; Fri, 3 Nov 2023 10:03:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2D4BB28000F; Fri, 3 Nov 2023 10:03:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 19BCB28001C; Fri, 3 Nov 2023 10:03:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 0AD1028000F for ; Fri, 3 Nov 2023 10:03:52 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id DDE871603A1 for ; Fri, 3 Nov 2023 14:03:51 +0000 (UTC) X-FDA: 81416811462.08.025ED03 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf10.hostedemail.com (Postfix) with ESMTP id E8444C001C for ; Fri, 3 Nov 2023 14:03:46 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 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=1699020228; 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=Tsyq15HMBORwL4FbDOu31lu8fOYHpX51tJA+WV10eik=; b=PGr1f46xVPh6kI9e/aEQNKA0lOlzutiFIoNNXrRXwcKo1IKfUCv126F5DIv0an2211slF4 Dmgj7ss/EEc01qVekLVp30ICCVFYeujAeZNiTSNWUA4bgxeg5mOfVBPXNvS+bwjyXrgpq7 aM88N7JsuQXPQDnLYFgtqsuH4A6pPrw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1699020228; a=rsa-sha256; cv=none; b=LDYcsxf3eeJCc7tvt4Du64Zv1pSoQZzfL8bjKKDrwKJ+9vnC3lVaqKn3m2kOw7BKVUShsy 0PGx1lpACkI+s6yUI4Mujco2mB0mIsQ/nkNkBsiuBbAJ4vVL55IsMEDT6j0ADnrbqDea3z R7wXBzkekpN2Uva22cHrGPIHv69l/ZE= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4SMMpG1TbrzrSJv; Fri, 3 Nov 2023 22:00:38 +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:42 +0800 From: Kefeng Wang To: Andrew Morton CC: , , Matthew Wilcox , David Hildenbrand , , Kefeng Wang Subject: [PATCH rfc 00/18] mm: convert to use folio mm counter Date: Fri, 3 Nov 2023 22:01:01 +0800 Message-ID: <20231103140119.2306578-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: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Stat-Signature: 6st9af3gfqfzdacmgcw5jbbdgwmuas3f X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: E8444C001C X-Rspam-User: X-HE-Tag: 1699020226-693393 X-HE-Meta: U2FsdGVkX18/D6dpyG+jBSjhndbge3ufivzAfurU3imC+HUkMXZuLLgVac6ZoxKrlFX0E6jAM28aeFJvc/UJgpwW7Z08DuHLcUXq2U2RmMjPvG3AQxCdyWSWbt3BucGRHV5X4KD+ABGbkm8leuww/REM+G0KiHWT6Ws3oLPTh/mXXgetH8Zi1k5Js/rOBji/rdl9gkSI92KRcQ0HFn0LuS3UTGlG7fIk7LFdkwJVlX15BrAd3wWxJU2DGeLmLMrWOoVf01o/Dpe7VFLRHKzxZrKV0w3Kx5vpgP9Buf3Tei7pr950LN+72ZZo3gTmYL0fUKUKO+UGJjS/ePjVsBpx7ma0uhhIcUKhMgUn0R7PpARAq3vKR1BlRrKD0EnDACYG3cameIShLNSTR5LE/ulw3eQy2qk++nKIHhc1uXwvDooVgjKAa1urgBb3Zp7Lnag8OGK1VSnANSgBYMsm5wo49dcCXuic3XD/GT8J0SPBA7ADRzpZ6RW2RL71iptTHKcBr2v0PEfvWbpN0v4nEDslpCfO55g8nQ36NfTtW9lyerYsHrRgWYucKgMJmld84spTBq2dLz7+QyilsGwETjuqlX9HZKOl7XE7k0oFFKYakOImnzv06sEAYY3lNFR3dLbZBh8aA+7ehQZiWq2czlR1LY8hnHA4dW1t2sKqQhxuJ0yI06wmhx3AZR0hgSUJvUkAnrc3PA9Ew2SKg1HK1vZ/CGSC2czQ5wjgAFiqctrBqJ14bYcRS0t6k9XAvLkI8wmaT0K8IDnzNxEUMFmU0ch6KPBM19vHxNX5/3L4Db8uVkqFnDJyAm2vuohRfG8o1Sb6EkfSFXbQPxRir6ZklBhWh/JXOzAor+S5jnlnPGuPXeyzp0XFPbVg1DMN/LgOTjwJdS57LUEgV5xQh+QwcktozPQ0CCTSKRk1WS0rqolpTZRSfVR1xj7tMLhtFCbak3auLgc0mrsjPIqzA7mwWdC Gh90t5ZR ePvFkGvlCnenhH41Zd1SSQItPG6v97F7iwkY/EUwrQ97WNWoYr4bo3VFFAkA8nectCcG0CYFFhoTMz7QOnylxwBTU8ZlEMyoGBs94d5svCSDt6G4akiyiHXY2Kg== 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: Convert mm counter page functions to folio ones. mm_counter() -> mm_counter_folio() mm_counter_file() -> mm_counter_file_folio() Maybe it's better to rename folio mm counter function back to mm_counter() and mm_counter_file() after all conversion? Kefeng Wang (18): mm: add mm_counter_folio() and mm_counter_file_folio() uprobes: use mm_counter_file_folio() mm: userfaultfd: use mm_counter_folio() mm: rmap: use mm_counter_[file]_folio() mm: swap: introduce pfn_swap_entry_to_folio() mm: huge_memory: use a folio in __split_huge_pmd_locked() mm: huge_memory: use a folio in zap_huge_pmd() mm: khugepaged: use mm_counter_file_folio() in collapse_pte_mapped_thp() mm: memory: use a folio in do_set_pmd() mm: memory: use mm_counter_file_folio() in copy_present_pte() mm: memory: use mm_counter_file_folio() in wp_page_copy() mm: memory: use mm_counter_file_folio() in set_pte_range() mm: memory: use a folio in insert_page_into_pte_locked() mm: remove mm_counter_file() mm: memory: use a folio in copy_nonpresent_pte() mm: use a folio in zap_pte_range() s390: pgtable: use mm_counter_folio() in ptep_zap_swap_entry() mm: remove mm_counter() 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 | 25 +++++++------ mm/khugepaged.c | 4 +-- mm/memory.c | 77 +++++++++++++++++++++++------------------ mm/rmap.c | 10 +++--- mm/userfaultfd.c | 4 +-- 9 files changed, 88 insertions(+), 63 deletions(-)