From patchwork Thu Jan 11 11:12:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13517210 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 F02BBC4707B for ; Thu, 11 Jan 2024 11:13:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 692DD6B0093; Thu, 11 Jan 2024 06:13:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 642676B0095; Thu, 11 Jan 2024 06:13:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 531326B0096; Thu, 11 Jan 2024 06:13:38 -0500 (EST) 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 44C3A6B0093 for ; Thu, 11 Jan 2024 06:13:38 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 16178C0A0A for ; Thu, 11 Jan 2024 11:13:38 +0000 (UTC) X-FDA: 81666769716.18.CEA6A9A Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf25.hostedemail.com (Postfix) with ESMTP id AB982A0002 for ; Thu, 11 Jan 2024 11:13:35 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=none; spf=pass (imf25.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.255 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=1704971616; 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=ZAq4KJh0cLqgAaKqJ36jg1QWFgkzpnlTbkAFI7j+f/w=; b=Gfgi+waUJQXNLF5EDaEXQv1cFptMjMOwkYN1eKszYrl8E3iHI4KflUCcNVInVF+bEAnwoR gDqIiY4glk9xndFZBdugzA2Dg5jgq+Nj8+UmCUi4kP2CDQBcAlqeEcqMJAD+pwiz0ICvhR s9YEKKHNxyp6S1VuCQmzLD4FGIiGUDQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704971616; a=rsa-sha256; cv=none; b=YyttESrODuxxjfuFUsmZQMH0Ed9yc1VPfeD1GP/8COjwm6pGPls2wR+C4OPp4YegqzabGl Ebuz/IwecwaO1xgHXH+KtHGHdZyvQRyKQt7qmEWWGv6NKmp+04uEtiff+RlXWvCSlppJFz fEKuUfiv9/xEAVfSdS2gM85Q0v3J9pQ= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=none; spf=pass (imf25.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4T9hph5J6mz1Q7J4; Thu, 11 Jan 2024 19:12:44 +0800 (CST) Received: from dggpemm100001.china.huawei.com (unknown [7.185.36.93]) by mail.maildlp.com (Postfix) with ESMTPS id 6EC94140384; Thu, 11 Jan 2024 19:13:30 +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.35; Thu, 11 Jan 2024 19:13:29 +0800 From: Kefeng Wang To: Andrew Morton , CC: , , , , Kefeng Wang Subject: [PATCH v2 0/8] mm: convert mm counter to take a folio Date: Thu, 11 Jan 2024 19:12:31 +0800 Message-ID: <20240111111239.2453282-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-Rspamd-Queue-Id: AB982A0002 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: rt87eqidu5bff93jffofeng7xqiyhzp1 X-HE-Tag: 1704971615-732047 X-HE-Meta: U2FsdGVkX1+KxT0hqEidn3whBk6ez4LH3gTXkJ4PBEi69VDaHv5iMedfFwSXoKC6YanDk1Io7H8q315tID/E/pP8m51ZsePFUATHGCtL03sDc+Emv12DatHHwbDDYXwMhURphSan+Y/a02RIOkRxp7mlUUfL+cqF4uVGmvlHlDfffWB1OwjYFVOwvumE0ahLnlMr22CegcBLS1XguUGN580YkaeZnZmApwDWJ22fqpwnVGIqaHVg0K5pKgj6ZUOlEFg/jAuxdh+DUOzPK10FN0peUqDhZLPVMjzpEfxJYYxJfWUyZBjduCOBBg/jCLyazumCuDnB50KniYM9b6UOfjsLqwU6gbjM9kq0huei2sIKMEZCIO96swX5yidd+77aoUdd01YbVlOdOlDgb6AtDtsEBcTWPa4OKdWP479NMYUao6YasVBRUcWziO9j3Qx/DxjKkjNduZpmS6n2rciXEEzV4fgaWUsJi+O6Z5z4EavY8MV6/EtMVOzZOKaUr0gLFg4V5XbP+dDiAHckIaqqcDu54j0S2AHu+GDoU4Md9frIg8vSbdcSemySheQVWTUx4sasrCtFzz9tUcoHttbRQNgDx837Gpf4hONDYiy6rx+aakOb4QGiSA/rZtq7h5F1YjsVkBmaSy4extWXeRPVIHu8YcCGniDrT0+5bg7Od+Eg7g8QanrIE3dt4c/gfpQFAuuOMxvk5AWb+ZkkSSbPkEELX081PPfEiqGdsHCiHsfnBnnpRZLD2RRAbR4xK/H3AztLK75AytcvowqFc945UjMBJoSbs/RKtRfh9pHEEGdwRUvNumf+CdBsmmcFX5g7u9xuxqfsp2m4Xm6CkcW4AtNLcO2GTdQS0TGgAKHkauaMvG7ZFef60hFruhKFOkhQkAcGfFVLH7GaWOeWD3WMdSg5ilDrhQrWCm8v2xHdGHzIErpSutWEOmhp9sCi99ig/QTYDYFN85QKXrKO8nY YTy/bRDc Kya5lk+tBxR+rD+OZrzIQF53bUkpKJ0iUtahdUvKHzPRbGNTJhobe39YALSX8e4tiWUZRacvdT/dwGJpXHiSvr5g9qfOfLM23qjBHcjC+o0XB9QI60aD7FDcr2oR5cB84GEYwG7e2j1UttisGC2TBaCrc+oPpO7pBpyKv 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 some of compound_head() calls. v2: - rebase on v6.7, since most of mm counter callers already with a folio, drop some unneeded changes. 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 (8): mm: swap: introduce pfn_swap_entry_to_folio() s390: pgtable: use pfn_swap_entry_to_folio() in ptep_zap_swap_entry() mm: huge_memory: use pfn_swap_entry_to_folio() in __split_huge_pmd_locked() mm: huge_memory: use pfn_swap_entry_to_folio() in zap_huge_pmd() mm: memory: use pfn_swap_entry_to_folio() in copy_nonpresent_pte() mm: memory: convert to should_zap_folio() 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 | 21 ++++++++++-------- mm/khugepaged.c | 4 ++-- mm/memory.c | 49 ++++++++++++++++++++++------------------- mm/rmap.c | 10 ++++----- mm/userfaultfd.c | 2 +- 9 files changed, 68 insertions(+), 49 deletions(-)