From patchwork Wed Apr 24 13:59:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13641926 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 536B5C4345F for ; Wed, 24 Apr 2024 14:00:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DB11D8D0025; Wed, 24 Apr 2024 09:59:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D64D68D0017; Wed, 24 Apr 2024 09:59:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BDF188D001F; Wed, 24 Apr 2024 09:59:47 -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 8EF168D001F for ; Wed, 24 Apr 2024 09:59:47 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 4EBAC161011 for ; Wed, 24 Apr 2024 13:59:47 +0000 (UTC) X-FDA: 82044583614.05.151CD0B Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by imf19.hostedemail.com (Postfix) with ESMTP id 218CE1A001E; Wed, 24 Apr 2024 13:59:43 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=none; spf=pass (imf19.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.32 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=1713967185; 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=mps2PVum0eLnbJWRuh/v2qps3mbA1AtkDvxPmi80hF4=; b=6Lr279lbS1XNPBiGtMDzXQRCsvLEi7FBlvu+Qk1EvdMMB+15Ivl685e9uZhXAUiRkrpCWA YAT07f48CGWUUDKsbSG2dA4Zme/83prYP4ssi9yKTBuC+BnzLv2pjoaq0Qj5gEiXeljOD+ XJoB06cvBQZqE5MO7ocbAtGuqOsGWuk= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; spf=pass (imf19.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.32 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=1713967185; a=rsa-sha256; cv=none; b=ovPPsY5bCs02eQUoLeu5z9oDBcEp8lf2rTEXxE0McsfdXJdPvBmwB3R/BU5jMpgKCXiNny Wc9iYLoimJjKYmwh6Mm9QDWPdR2WyxogxP642S8r4G7Pt2iG3XV/jwL69gmjVCDQEMsFS+ jo4EC8sJWhODdJa6bE/06m2neHxhFV4= Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4VPgZ720KBz1wr57; Wed, 24 Apr 2024 21:58:39 +0800 (CST) Received: from dggpemm100001.china.huawei.com (unknown [7.185.36.93]) by mail.maildlp.com (Postfix) with ESMTPS id E92A81403D4; Wed, 24 Apr 2024 21:59:40 +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; Wed, 24 Apr 2024 21:59:40 +0800 From: Kefeng Wang To: Andrew Morton , CC: Tony Luck , Miaohe Lin , Naoya Horiguchi , Matthew Wilcox , David Hildenbrand , Muchun Song , Benjamin LaHaise , , , , Zi Yan , Jiaqi Yan , Hugh Dickins , Vishal Moola , Kefeng Wang Subject: [PATCH v2 10/10] mm: migrate: remove folio_migrate_copy() Date: Wed, 24 Apr 2024 21:59:29 +0800 Message-ID: <20240424135929.2847185-11-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240424135929.2847185-1-wangkefeng.wang@huawei.com> References: <20240424135929.2847185-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-Rspamd-Queue-Id: 218CE1A001E X-Stat-Signature: u394yck1r78jy7u1db1n3ri8a8xr1jad X-Rspam-User: X-Rspamd-Server: rspam07 X-HE-Tag: 1713967183-333831 X-HE-Meta: U2FsdGVkX18fW3Msmcta1q8RnwG+Brd6WGBJoKlaKJlWg1tQTQoFL0wUKcm4s6juTqFh79M0zwfYxVkIrpAScv8A2IockBiJHQXlUwhWYL80GDWAETo+XMZl/CHJoQ8ilt3OstLehqohbYmEpxJ2hzzmw2ue0YbMK9c0cBljmsUcWmwTE+iWa+OcmPxIDpakHyeHd2lGtT1zoG//6pnTcLCpdRk910PKAWbwCc1GMhbE+k9CMoJ7ttZiP/+wkj8DlrrWb5YSuxPoDCQKoPjy7S64mQ4I7lgBSk606/xm7Dc/dVEeb6NQMfOrNIBwVutyihRLWW7pvNvYxuXA/HWWsLzNUcaKmF8fBECurMfZevF7T/SAQbWCD594x70Nj8mR+P3Qrk00eKB/yKz7q5m0bIvkSvagFWZobDAXLev2HYx2J3M9S1cm+qhtUGOohyUtKJeBoVqRWDhWVdshRPjWAArmd5d+r/dCI234F6Wniu85heAxptiHvyXrbC9mmH7k53DxzADNPsMG61WwdCWhusDd9d5v3yY4yICdsk6r81T7gXzYfSMeDI4bm14qV93YP2Zx6tVnDykOPJ7UGjI7iLnWx6dem7kzf1XQD7N7ZHaFYrJFRNarr5lu5RbtL6DgkEyly+0BFil0JQNBeaqrvftr0Xt26YcmnngtnqglEJNXDwHv3Ry8LHN14y15ANnicrQE7XCTDbpRXXJEkBK20lf8bu7ozAEISTZY2pbSoeHjDESO4MTl0+uxTEnUs+UrJTPUYqxMUdbT3fRxjNBEP4iGoHBi3t3HMlNwZWiCOtMisb9mX6X+wlyGMgAnQhyusA2kmLhK/4j/1Qwouajh8K/S8Py/BNHASHGr0q891r+yrcomQyi2+StHVC+h5nEYOr6wvRMKWYMaCJWhuxXfo27iV9+F7VGB8L7CFY30TtEHOg/zqLDYQBzw+gn2ELLhqDt4Q2wraeRtniHcbRe XzA== 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 dc7a10f2a6e2..ea7b956fd900 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 535d1a5561c4..b9966d4355d0 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 4493ef57c99f..f393e66813dc 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -687,13 +687,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 ***********************************************************/