Message ID | 20231103140119.2306578-1-wangkefeng.wang@huawei.com |
---|---|
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 j7csp1055563vqu; Fri, 3 Nov 2023 07:04:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHAP00e2iHd4tspBIi4QT3w+5anQ/JhaN9mSQKF2OYlxDlcKhiiU90/7MIp2iGxelfbWN5s X-Received: by 2002:a17:902:f551:b0:1cc:5b2a:2f33 with SMTP id h17-20020a170902f55100b001cc5b2a2f33mr14442155plf.43.1699020247188; Fri, 03 Nov 2023 07:04:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699020247; cv=none; d=google.com; s=arc-20160816; b=cOM1MyBP6XIXea8bUqWXZWKtMp8NKWJfKfGL3vgd7R920M25AjgIr9M3tUjCTrlAff 8rqr5ZW6ZYauxQ9rO6VE6JfFIegEWn8NdeBjJXKARWkhZXi1sm4vpwp157GcLZhOfoe2 X/HrdZWrrEXQDPpS7wJZGo26tZeM0wXdruc4A2FURzD6wzjr52DCNd+xBHTaeQ/yC/fq tk5w7Mt/qxXxvHkZni3IAXn0JBHtaZwX+yBuW9/3UOjq8eYLP25bNcihXBdMm/sJnoFh 6wIGxAYRUHsBkEydHvRR0ZgIsrJpGLWAS0a9O8WW3HZ9cp607eJOPInHlzkdIRHPIMEc T7Og== 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 :message-id:date:subject:cc:to:from; bh=Tsyq15HMBORwL4FbDOu31lu8fOYHpX51tJA+WV10eik=; fh=kUj/5waaepfljbNx30rj2BALdV0u/mUCTaFWThlgquQ=; b=odUIbZWaBhsS7MpjRm70b5b+idWRNXPH0qz5jlfs1WQID4qhnGxXwIfaM8Ca+eQmSc q5iB3BS+dSTg8Lv2JtbHe4eCfpM04FQxkt/DdPdZl9wNkxF9DIhgngDFPthkPVxUTeiH sn3ImUx8z94qjF679e0szJ8Aa5ziZ99iT8BSQPLmnkibL8K7D1Yg8QPbZdGOctY3Akx8 2mTPAlHDLvaL3Gk3CGJ+z5oTbcMhPe8ZeHE8K48DVDwKBOaM5Pvo1j9zqXM0xzm0/EYE 6zaaZIpJJB7/PySqVhLv8Xx0Z+Hli7eTQ0mm+Oewu2ygOta7AIjwr9bt6jc40r6C6lmm uevw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id ba2-20020a170902720200b001cc2ed18253si1527501plb.15.2023.11.03.07.03.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 07:04:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 5B3C2804E735; Fri, 3 Nov 2023 07:03:57 -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 S1377746AbjKCODu (ORCPT <rfc822;lhua1029@gmail.com> + 36 others); Fri, 3 Nov 2023 10:03:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233674AbjKCODs (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 3 Nov 2023 10:03:48 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34209D4D; Fri, 3 Nov 2023 07:03:45 -0700 (PDT) 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 <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 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 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=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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:03:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781551855054040632 X-GMAIL-MSGID: 1781551855054040632 |
Series |
mm: convert to use folio mm counter
|
|
Message
Kefeng Wang
Nov. 3, 2023, 2:01 p.m. UTC
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(-)
Comments
On Fri, Nov 03, 2023 at 10:01:01PM +0800, Kefeng Wang wrote: > 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? I deliberately didn't do this because it's mostly churn. Once all callers of mm_counter() and mm_counter_file() have been converted to use folios, we can do one big patch to convert all callers to pass a folio instead of a page.
On 2023/11/3 22:30, Matthew Wilcox wrote: > On Fri, Nov 03, 2023 at 10:01:01PM +0800, Kefeng Wang wrote: >> 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? > > I deliberately didn't do this because it's mostly churn. > Once all callers of mm_counter() and mm_counter_file() have been > converted to use folios, we can do one big patch to convert all > callers to pass a folio instead of a page. > I re-order the patches as you say, please help to check v2, thanks.