From patchwork Thu Mar 21 03:27:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13598372 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 7E21EC54E68 for ; Thu, 21 Mar 2024 03:29:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 681EB6B00A3; Wed, 20 Mar 2024 23:29:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5C2B86B00A6; Wed, 20 Mar 2024 23:29:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 042CD6B00A6; Wed, 20 Mar 2024 23:29:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id C37C86B00A6 for ; Wed, 20 Mar 2024 23:29:01 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id A262D80963 for ; Thu, 21 Mar 2024 03:29:01 +0000 (UTC) X-FDA: 81919614882.27.66F3080 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf05.hostedemail.com (Postfix) with ESMTP id 62BDE100005; Thu, 21 Mar 2024 03:28:57 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=none; spf=pass (imf05.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=1710991739; 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=h6Tg1jssGnEQEtsC+7/Br4Zf26AraPHqNWoI9Ccn610=; b=8qAenkns6qGMS3CNIOhpkReKEWDMegIVCeczjrToKDJfkx//I1UtF50cXTL1o+pZaezP8P fFT39zpv5ZSEuaOheIQ8yaBA9h5r8kIMpO8exW+fJejzs9U8/2sMqcEZ3qen3SwHZUq1uw xeyiX8aDwzBEeym1G+KGypK1GD3xYZA= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; spf=pass (imf05.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=1710991739; a=rsa-sha256; cv=none; b=Ekh7Rpr5fR0s3A0R34YrZR/8hB6JvAXPC7ngtIuRHDW8IQWFmQEwkhpIfd1mQ/yMaAT8BW dboAkwyptPsp7cWN2V4XoJDgBevlnrLxl/Ei4/mB5QOownLK/qMy8sfFxrTTIaKaqHeMHu t19Pba84oo1OtXBnadJOPLHxGzBahZw= Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4V0W8Z226Xz1Q9rf; Thu, 21 Mar 2024 11:26:38 +0800 (CST) Received: from dggpemm100001.china.huawei.com (unknown [7.185.36.93]) by mail.maildlp.com (Postfix) with ESMTPS id 3911E14011F; Thu, 21 Mar 2024 11:28:55 +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.35; Thu, 21 Mar 2024 11:28:54 +0800 From: Kefeng Wang To: Andrew Morton , CC: Tony Luck , Naoya Horiguchi , Miaohe Lin , Matthew Wilcox , David Hildenbrand , Muchun Song , Benjamin LaHaise , , , , Zi Yan , Jiaqi Yan , Hugh Dickins , Kefeng Wang Subject: [PATCH v1 10/11] mm: migrate: remove folio_migrate_copy() Date: Thu, 21 Mar 2024 11:27:46 +0800 Message-ID: <20240321032747.87694-11-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240321032747.87694-1-wangkefeng.wang@huawei.com> References: <20240321032747.87694-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm100001.china.huawei.com (7.185.36.93) X-Rspamd-Queue-Id: 62BDE100005 X-Rspam-User: X-Stat-Signature: 3e911y3u7zju3u9h5ztx13gay6466wi6 X-Rspamd-Server: rspam01 X-HE-Tag: 1710991737-511761 X-HE-Meta: U2FsdGVkX187W8bsx+G/kUHEwJpJSpJTEkJ+TlEQSOD+StdG+aDzX61LuUTeHe9hK6lrusS6jhnCdkkKZcgxH//nPrxiyFoLGSYeIaGnIKBBsoux1WaD8S1wBtBCjOK4qOjYQpyldADzuC6YqlkXRkB72wUgKxJO9/fCnPGo6jGkLZCj/xNVbdrp6NgZE083dVJxL3GCy3RZMOkJmvu2ldJSKyyb++UqyyM4ilmBGkiDUmGPUMkaiedpkfJoTrS1bkM98qMDbgFuLqakBrVtRVqMPaIAUHv3A/5M6QCzk+65jh0uputTdLdZcw7OVr4QG42JIGvj8bQLVm3+ozUfNGIsoT6IUl+6YPYZ8JF6hYKNiB86zVYf4gtgO4jSRrUZzVuRGBZTSXNB+IThBqCw9lbYiWRbZ9YXdtVFzoTDRh8SMhdMhfVT5qAlR9ek1BygtX1S087TuxzWhYfJCI0OaWoGCwaMu2qD569LaiVVX3UryYxEwrI6XBP8g5MYBYD/mYd+lDVLHVdKIlTv8N5HhKxPTKwzhGIYQsZKS0ff3E804rqUbtAzFGrwxhJBiHouxLG7BU0kBrx2bg78t0afbFnHjBdiO8AQ8ViAQN+agIGTGM1ByMWCPlEb6NpoVyeLPHRNzvmAnwRWnA0coBXY7bw9crv2s/nm8qoLdpzsTP+teWqzDc1d6pLoe7KFB+a/OlkrLwPPaxlHhjmWQ8hrCMKhv4a2UxsEISE6l6OtwfPbcw5rTl9XtH6DxGEVxF7ggxcNw4SZV1hZZGlMa00UPgKaa7CovNFUT6rgVuc7his9o/2a/dmDZMAMBq1u0M+RnqTw/zd19/Cg2qtcK+rgZcQjqDrUQvaQL6y2wZXV4+jhpTfM4zQMkYQSf/EZBNXzLDO+l1WG3yyIUUMJfSP6i1R8coC7g4K5a38SKQBjMyRe9AcSvwY/o+CclBburxtOibeQtM8pN6Ddz0pQKN/ 67WP/aEa 9csVA0ew5XFcDrwwQ5HpGv4Y7c+E6cIyit1RqBsWXG6/zxL4fjYCZsyqlvdB/yqoItPJdcXebWHXb+syqCdTXNbf3DCl/g/Dlej+tSXkZq2c1ayR5bPnZ5MMUgzI2GpDE253bx3b1is9wGGL6UEAId3sFfoL6kXPYpaTBMyy6dqI1+OuG6Fboz77s6nfxniirCXde 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 --- 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 e36849a38f13..9783bb5d81e7 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -454,7 +454,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_pages[idx] != &src->page); ctx->ring_pages[idx] = &dst->page; 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 c0e2a26df30b..2228ca681afb 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -661,13 +661,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 ***********************************************************/