From patchwork Tue Jun 18 09:12:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13702000 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 9CAF3C27C4F for ; Tue, 18 Jun 2024 09:13:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 112CC8D0002; Tue, 18 Jun 2024 05:13:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E3E348D0023; Tue, 18 Jun 2024 05:13:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B51568D001F; Tue, 18 Jun 2024 05:13:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 898768D0020 for ; Tue, 18 Jun 2024 05:13:14 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id C2626140635 for ; Tue, 18 Jun 2024 09:13:13 +0000 (UTC) X-FDA: 82243445466.10.4708726 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf30.hostedemail.com (Postfix) with ESMTP id 570F980002 for ; Tue, 18 Jun 2024 09:13:11 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; spf=pass (imf30.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=1718701987; 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=6fXe+K9uKs/sUSfj8aKTwJ54u1D7LYUM7vLJAez/yXw=; b=DmfMiKMblKttiBqEsLvoZ4X0qn9fZAMaNQdtn2U1xoqrNPPhAgddY3QwmFNn+kGEd+WetM nf62qHvK2g/j0Osb/zjQ5QerOneTP3h8YIZB9p/JauXK/kB8PGTfILEjNxXo2SDK+kwaI9 yo3nOt+ipSBjYubKh67UZoGF/P1iGpU= 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.255 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718701987; a=rsa-sha256; cv=none; b=kwbkWitt8ddComsoVOgXHXZ/7AjQwkebM9mLfyIHb2oUmZQkyljO333O1GeiBKQyPD6KXf aqWuOQ2rgJnygQbTPLSdJmdNCQj0y1QYO3vVAzifQHzurA2ruZoCFVkV7ktjU9kvI3qS5J h+T0GLsuXUfl9jg0eTNTVbrxnEs+MHQ= Received: from mail.maildlp.com (unknown [172.19.88.105]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4W3LXP1cFcz1SBMT; Tue, 18 Jun 2024 17:08:53 +0800 (CST) Received: from dggpemf100008.china.huawei.com (unknown [7.185.36.138]) by mail.maildlp.com (Postfix) with ESMTPS id B2D611402C8; Tue, 18 Jun 2024 17:13:06 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemf100008.china.huawei.com (7.185.36.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 18 Jun 2024 17:13:06 +0800 From: Kefeng Wang To: Andrew Morton CC: Muchun Song , "Matthew Wilcox (Oracle)" , David Hildenbrand , , Huang Ying , Kefeng Wang Subject: [PATCH v2 0/4] mm: improve clear and copy user folio Date: Tue, 18 Jun 2024 17:12:38 +0800 Message-ID: <20240618091242.2140164-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: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemf100008.china.huawei.com (7.185.36.138) X-Stat-Signature: dskrbmpyx73t6zr8kgdm7dier98bftqs X-Rspam-User: X-Rspamd-Queue-Id: 570F980002 X-Rspamd-Server: rspam02 X-HE-Tag: 1718701991-887323 X-HE-Meta: U2FsdGVkX19abecN7doh/VJUP8YLUfK5Ns9l6OJWdagstVC4n7ctuzlqBAH9LWfziom6KEwuELg4/KLLV9FqOpmtKRkGx7ffU/XAkimLw4Pqs+EZKg+4zoxCgzQ8tgakrBFUArgPtArNxPIBsg8SL7TS+FSjwJMYXUDbHkJwNvSh4yl0ApGi7IIoH56JJSDVnVEnWyILps3UnOTBnlU6XpQ8SPcVHCFoHHT4Dio5YEK9U3epZrxQd5d8QJAZcTOEnUqvlBnHtVF5f8NYBIiuK7s7NRfaWz7fRvrCwBWXK9GcIYx9UxLM1GQ3iEYI+NWTkPPNiebUZx8bKIQ4Ts0XXMs0uPL9qZberPhNwO69XvHJld/xdJK3LVfDatbwtdTx91wA+RSW8r64wnQniTiAEhTRk2LoKoGzc9WprvQ4QT1cq+0a6FJc3ayMgvH1+TvXHWqznuGAXMDLCuNThXhyuM2MUhqAsfKjhL7Z1tOYSSE1HZO2xA83HtKitH2RJyfz8Te0z89JBvEsQiRjokOeGy8otj+PkjWRseQ6DxBVdj2goilxesv9j7ygt//KpqZ2KMY5o7n7BWXYNNpHljTdyWd4lzaMdL2H9slTzRVjmPfB0lPoeTWL47mvXijj0pUS9nJvtCtXa5Gj5pGm9x/fw+J2B83M8iT02/1eZdsm3Nj6g/rZrx8IA4/hNkn+Np/OfYTbmCnonA9Njbo9OU8Ier2Y8mhsR2/kPdXPNgH0Fe6zgrhKsRPImyNuhkOvT1R1spylf8kgm2b+ysoopQcBhyZUCLDjSSevIgFI525SRU6lGPqDkNV/n7XkZEDhDeb/fykMUOe3reknSr1xuNrBIH4oW+pL6apdBMK0Ne3FotCRIZM8Eh0vtup7BAozJlpjMNGZw9AE9Jee+2FMVtdMs3h87/9biAkVkcvcKOC+p71w3TD3V/i1HtJBonD9AvsZhtbPAPAaiwZmto7Ubkd 1gfs1tnk YBM9rNKk9TiYWIORTINFq3ROHtfTc5brMF4wFzEhoVcTP/Agp+68hSOuaHa/Q5YQn/kZQMPc+TVzsolS9xCd6pJLbR5drO4aWLb7C2CVc+xrh6iabqE0OXVu6YA== 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: The most are some folio conversions, another improvement is that move address alignment into the caller as it is only needed if we don't know which address will be accessed when clear/copy user folio. v2: - rename clear_large_folio to folio_zero_user and move alignment out, per Matthew, but still use addr_hint name since it is for cache hint, or maybe user_addr_hint ? - improve copy_user_large_folio() and rename pages_per_huge_page - add ACK Kefeng Wang (4): mm: memory: convert clear_huge_page() to folio_zero_user() mm: memory: use folio in struct copy_subpage_arg mm: memory: improve copy_user_large_folio() mm: memory: rename pages_per_huge_page to nr_pages fs/hugetlbfs/inode.c | 2 +- include/linux/mm.h | 4 +-- mm/huge_memory.c | 4 +-- mm/hugetlb.c | 21 +++++------- mm/memory.c | 81 +++++++++++++++++++++----------------------- 5 files changed, 51 insertions(+), 61 deletions(-)