From patchwork Sat Nov 4 03:55:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13445388 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 66777C00A5A for ; Sat, 4 Nov 2023 03:56:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EFA8B8D00D7; Fri, 3 Nov 2023 23:56:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EA9748D00D5; Fri, 3 Nov 2023 23:56:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D72B18D00D7; Fri, 3 Nov 2023 23:56:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id C65DE8D00D5 for ; Fri, 3 Nov 2023 23:56:02 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id A22F7A0DA8 for ; Sat, 4 Nov 2023 03:56:02 +0000 (UTC) X-FDA: 81418908564.27.0029B13 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf30.hostedemail.com (Postfix) with ESMTP id 632A680002 for ; Sat, 4 Nov 2023 03:55:59 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; spf=pass (imf30.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 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=1699070160; 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=rr9s3lwcK47y7hDLfjGBnZ4gwlc32lagg4W+ihXgtFU=; b=h7utmfHTjb8woIiEwke48NYfa/tMYLLDTALUlFBAamYmLFOgcm0LUxmBYMZBDIQTiv2cpG gIX7GUAkXgjDbYSMm7x2mbrzRedMczhC8IpSt/LepkskjdIBGYzC6+VSLzQfnQ1s0nc2NH 5MDSv8FZ1AwNuTJAC5FwTVG8Wr/vZlM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1699070160; a=rsa-sha256; cv=none; b=Rxgk6DWbPGjuet+DgRNJ/R0LzpiQUJeqKJcawH1WDhHF499mx50YpYECDMCS3t8SKdRb5m SvnuwEFihYkSNBItoV46+Yt8P7VmxbwMnX6eJxCBVCIh88vDpXK+Z0rewF8tMbAZ8yPYZT cHaj4VUUeUEuf3Zrt10ytv0ybOjb2y4= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; spf=pass (imf30.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 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.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4SMkKf5Cg6zVl5J; Sat, 4 Nov 2023 11:55:34 +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; Sat, 4 Nov 2023 11:55:40 +0800 From: Kefeng Wang To: Andrew Morton CC: , , Matthew Wilcox , David Hildenbrand , , Kefeng Wang Subject: [PATCH rfc v2 00/10] mm: convert mm counter to take a folio Date: Sat, 4 Nov 2023 11:55:12 +0800 Message-ID: <20231104035522.2418660-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: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Stat-Signature: gn4efaosqnhp39ij3anramq77srek3ag X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 632A680002 X-Rspam-User: X-HE-Tag: 1699070159-571033 X-HE-Meta: U2FsdGVkX1+T7mvAfuq2AuadgPe035CaeRHnI2dB7Vuv1/dQ1DdNUuadmxoNJ5fLqxPnPXBs0HPzUjyO0GrYepQHUIXfGrn+A6fS0nMVOWXfb1tqLUTyQoh7z3o1xNB0lu425/hTdBZxtRMh5vtyqfz+LjUQt74nkFYtbHRWxi6GK/T+BkyIQYAzuiHzgAc3rm+YTfNl9xhndxc0/OOqM68AIwfchCiVINocyWiOYbx16Bwvw+YrVPDuWK6tbSBxZJ9hE+JuHfQZiIlswtRnyNKWsgrQR5tnf0ZqfolvF7F+1dPHhu99Yk1EoYGGiDFax9IhlssfHONzV84/z842f2WzEHvRtg3Dl90ySLtoWameaPPJd1yX7xYcwYpVDxxP4+zrRIk4DW5Ccy/hTMYT9xGt6xcAPJC2QsHDj04pcI3i3aswOUjW+OeyY7PZtV9pDn17TgDli17389WI2ccaVc36XGaMZwxvqIqRSe5ZiVORavJbO/cveaP16V5jNVbv/eisoe3pMtLHg2NKzKVyMwQOlqUE/q2hwMwGm7ZniuNEWglNLJ2/FqS+jDi0bt1MO6X1LESt+Sh46QKVb0sDTqnPhBVbFGgBoqbM20JJBo/j2BaZLVNYxq2RG5mfJ9No/z4oh+MF1n6T5lqb/7jFI6499W9kyjDd7rxS+vaYwVbFQuXn1JKILEEwE6nrD7w60XGaAHtLRngJoThdwywWTl5d0/Rc1e/PqAiTbTrALECtOmaFJ1u8xQYlMw4R4aPIKZ6QIUI0JefLGR1wSXWohxK/R9WYqaauplKaQN21fiDXzuvIBl9rYLOomR1kw5nLcaKhr7owFjcwWnzt0Ofp/DOyggDQhvXCfHrDEYlQVCSe28Ahj1wF4YguZBuxBH0zsS2wqNSA8CvEOQA2PROrzyT7y8D4PwYpyOy97dTo49K55FqYH7AkW5Qm1n1okdXP85hv65A93Fe/a49MFNs KISFSN1m ibqv0kHhFbebgs4gCCL4tg2awWEV6HY69H9rMOZxngboy3qU/66fymm+1pgtQI30B9OyJ64bC4MW6OiC3nfDtShEoslDUEflGSF0vFyDfsLCOIkWa2Bh6dPr16A== 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. 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, 94 insertions(+), 68 deletions(-)