From patchwork Mon Jun 3 09:24:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13683602 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 6FD07C25B75 for ; Mon, 3 Jun 2024 10:46:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AF1196B0099; Mon, 3 Jun 2024 06:46:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A55A56B0095; Mon, 3 Jun 2024 06:46:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6FCAD6B0095; Mon, 3 Jun 2024 06:46:09 -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 45E116B0099 for ; Mon, 3 Jun 2024 06:46:09 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 0A5A41C128E for ; Mon, 3 Jun 2024 10:46:09 +0000 (UTC) X-FDA: 82189247658.22.64B8481 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf25.hostedemail.com (Postfix) with ESMTP id 51FC6A0004; Mon, 3 Jun 2024 10:46:05 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=none; spf=pass (imf25.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=1717411567; 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:in-reply-to:references:references; bh=RwVzLGUCkaxnY+8tSjDUTzVT3nPZf3ETs1o/YpP6JBc=; b=fSsVJG1bp+rSGHOBJNAGKPLWvJ/Dcci6dfs+82GfSJcqd0Y5gtuDS4xrs90KNpdvcMLTNT XRkc46IDNPlVadWNwvitlit94JEjsehWLy5CO5wt+gTYH1eWFvrr2BrYdOk1heJ1DlZl4B pg0ZWyaenu3GSbvj7sX8ZBhq6dxkR+w= 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.188 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=1717411567; a=rsa-sha256; cv=none; b=vDLMEkF1Yhrofeuc3/9g4P/uf8XoqJwIC0k6fXPb6g7nrRv5ExTtX7etUpVisTYKjusBuY B0FV+w5w/J8mPYzbkakTv1lEFj3lsYM3zl12UtExmwMOw95coFTMOKu4FhYs0zwLwnpT82 n+fI+AtckzkPDvPSGMTmiFUi+Ji9xXM= Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Vt9Mr1JZvzclBm; Mon, 3 Jun 2024 18:44:40 +0800 (CST) Received: from dggpemm100001.china.huawei.com (unknown [7.185.36.93]) by mail.maildlp.com (Postfix) with ESMTPS id 5CF99140109; Mon, 3 Jun 2024 18:46:03 +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_256_GCM_SHA384) id 15.1.2507.39; Mon, 3 Jun 2024 18:46:02 +0800 From: Kefeng Wang To: , CC: Tony Luck , Miaohe Lin , , Matthew Wilcox , David Hildenbrand , Muchun Song , Benjamin LaHaise , , Jiaqi Yan , Hugh Dickins , Vishal Moola , Alistair Popple , Jane Chu , Oscar Salvador , Lance Yang , Kefeng Wang Subject: [PATCH v4 6/6] mm: migrate: remove folio_migrate_copy() Date: Mon, 3 Jun 2024 17:24:39 +0800 Message-ID: <20240603092439.3360652-7-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240603092439.3360652-1-wangkefeng.wang@huawei.com> References: <20240603092439.3360652-1-wangkefeng.wang@huawei.com> 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-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 51FC6A0004 X-Stat-Signature: y5ciyn43kiiaqndph5u4jwn16qggiaw7 X-HE-Tag: 1717411565-160486 X-HE-Meta: U2FsdGVkX18N9ftrwxNnIu6P3GjLbaaP7/KsDv3i6dPfyxmZ6HjQK61xbIZM14G0+R8uc/HTG/TfDoFNMwDjl/iaBnMS8Q/ZK0/Syds9e/djhJGwJpsQcwj0vKYAXsdW2JQzryh5ofxHq9uufGztPU3RibVMS39TXhfyzqQX5spS/5ELPNKG+oJLg1Et8PweMFOKnI9oMRkW6HrLHMaxHMa06P/yuE7x78ME8pVSpiT+FAhrXXz9B8YJqR8wlYjTn+BheqAWJ/IQ+cRszwvnRTY3cofmseJAsIcg/bO6jo+yzUy+Oaomr4so6Zm/rgvfDiafdKT6M2TTlO4/saA9LYr3wlVHbQk6UQ+CweKcN0FwARHLRlbc+VpyAbspIGybmGPXDUFvPBmHZ8TWgCtGV3Mvl1gByxk87xyh010FwFsQ+9DoGYJcaQRUslk63vp/YjC58faCa3pjvz5feeRE1xx+S7hFpglUJkuqV+5d3Z+zYKg6TBwR5bjnWIfOjqmLzvZbxoer2dhYXI+M5H8hJgTA1U23/u/zeS0JymuuK/2gbAxi7qJ8zE46Yn7ZhGDtIAdlP6lxr/b94Jm/i2usqNn5AjPcERFapvYrvOuAINkCkw2irVJSmSSiOZ+NMrnh025a07RBbJCZy4GpcrLybHYWy1u0gFc+JGQrEL5qQ7EpGx1fdSp8uQhdsYnUnCKIW5HmTLX7eDIkGHfiimll1PsswQocyIQc2lzKirFlshcRfnQnWY/KPUJ4tI0rkplmKGRIMQE6ssI+kArQ8YFnkcGOu8RvC1ooCke9BdPKzVXe5qFoTpOz00TF2etaM3ncJSfJhfaRVA/XlrfoZdPmgP3AO3HkU0QuLqv35hXXMzbDMAw5/NXDDhn4Bq3LWnKLMbt4I+CCANJayVp7p525sq5z2dLKxmOMPaPfNgqJj6kdUfyzB5ZzfL1MzRjbOfvTfWNqdgVK/oCxIsqFMLc RDh4a+tn mX96IZduSScAuH2ZjzC0LlNCzrNh2n93D4aihGg21F62xcxs6LQv8nVu6T/DIHix0w9A2KOvXnKNmD2EaySlJ6AthhCwds0NoJdUEODOROb3Ye257YuTjg+cKeX2h7/lx5iSimqvcRDEhV0xqL4xlGaienpOgUkLRShhgUHufblFedWoKK+MzoIV1apZA4dSXsr5BFt85BfgdvQsHzeAIrK4HUx3Ue7ncyv0V/ru1VpyfbI1MQyzQCWwqyyDWMXvPd8M45YJV/LGN4rA= 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 folio_migrate_copy() is just a wrapper of folio_copy() and folio_migrate_flags(), it is simple and only aio use it for now, unfold it and remove folio_migrate_copy(). Signed-off-by: Kefeng Wang Reviewed-by:  Jane Chu --- fs/aio.c | 3 ++- include/linux/migrate.h | 1 - mm/migrate.c | 7 ------- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/fs/aio.c b/fs/aio.c index 07ff8bbdcd2a..bcee11fcb08b 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -455,7 +455,8 @@ static int aio_migrate_folio(struct address_space *mapping, struct folio *dst, * events from being lost. */ spin_lock_irqsave(&ctx->completion_lock, flags); - folio_migrate_copy(dst, src); + folio_copy(dst, src); + folio_migrate_flags(dst, src); BUG_ON(ctx->ring_folios[idx] != src); ctx->ring_folios[idx] = dst; spin_unlock_irqrestore(&ctx->completion_lock, flags); diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 517f70b70620..f9d92482d117 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h @@ -76,7 +76,6 @@ int migrate_huge_page_move_mapping(struct address_space *mapping, void migration_entry_wait_on_locked(swp_entry_t entry, spinlock_t *ptl) __releases(ptl); void folio_migrate_flags(struct folio *newfolio, struct folio *folio); -void folio_migrate_copy(struct folio *newfolio, struct folio *folio); int folio_migrate_mapping(struct address_space *mapping, struct folio *newfolio, struct folio *folio, int extra_count); diff --git a/mm/migrate.c b/mm/migrate.c index e9b52a86f539..fe6ea3fb896e 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -652,13 +652,6 @@ void folio_migrate_flags(struct folio *newfolio, struct folio *folio) } EXPORT_SYMBOL(folio_migrate_flags); -void folio_migrate_copy(struct folio *newfolio, struct folio *folio) -{ - folio_copy(newfolio, folio); - folio_migrate_flags(newfolio, folio); -} -EXPORT_SYMBOL(folio_migrate_copy); - /************************************************************ * Migration functions ***********************************************************/