From patchwork Mon Jan 29 07:09:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13535068 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 EE8D2C47422 for ; Mon, 29 Jan 2024 07:10:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 842056B0096; Mon, 29 Jan 2024 02:10:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7A4E66B009A; Mon, 29 Jan 2024 02:10:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 420BC6B0093; Mon, 29 Jan 2024 02:10:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id A76A96B0099 for ; Mon, 29 Jan 2024 02:10:01 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 7B3541A04D4 for ; Mon, 29 Jan 2024 07:10:01 +0000 (UTC) X-FDA: 81731474202.06.4E18188 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf26.hostedemail.com (Postfix) with ESMTP id 9339A140011; Mon, 29 Jan 2024 07:09:57 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=none; spf=pass (imf26.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=1706512199; 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=uxhEctjVQ/oSS3d4gV6S1haGxLGuZKcXXk3SyxRDJCE=; b=oDINf6Zy9dGRvYmbTn/ErJV2uCZAn8MzaVnXzqHoc9bIiW1QD3TLuKBJ6gMBAfibIoPhTk 6xhrgagy+DsP8Cvb3KDPTMoTdYupHX/Rt+8UBOvZXejxTkQNDiAoHCViuIBPSZeuvriNog GdCa8WRqM+kyY4YF/aDGpU+j4/SfUdk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706512199; a=rsa-sha256; cv=none; b=5BlujqTcWlFAfU/mvgHU8Ij1QO1CAAdUkksshJD1i4B03QOFjRRqle+xurrXNp/s+EHPfc 1KTlifQYHc+o6peHDQeo5/wimdqC545oHR6kYMTtNBm/9i98S6x5r+jgmKdaVzpPRPk4Rq lcePN1ohT6ikjI67zoPSMfi69Un1pfw= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=none; spf=pass (imf26.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.48]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4TNfXp2JQ8z1Q8Z6; Mon, 29 Jan 2024 15:08:42 +0800 (CST) Received: from dggpemm100001.china.huawei.com (unknown [7.185.36.93]) by mail.maildlp.com (Postfix) with ESMTPS id 5C8D518005E; Mon, 29 Jan 2024 15:09:51 +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; Mon, 29 Jan 2024 15:09:50 +0800 From: Kefeng Wang To: Andrew Morton , CC: Tony Luck , Naoya Horiguchi , Miaohe Lin , Matthew Wilcox , David Hildenbrand , Muchun Song , Benjamin LaHaise , , , , Kefeng Wang Subject: [PATCH rfc 8/9] mm: migrate: remove folio_migrate_copy() Date: Mon, 29 Jan 2024 15:09:33 +0800 Message-ID: <20240129070934.3717659-9-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240129070934.3717659-1-wangkefeng.wang@huawei.com> References: <20240129070934.3717659-1-wangkefeng.wang@huawei.com> 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-Stat-Signature: efkisns713xcwoqpeo6w3u8d9mgd6kuc X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 9339A140011 X-Rspam-User: X-HE-Tag: 1706512197-761700 X-HE-Meta: U2FsdGVkX19f6TQeJd5BEK3LDeOSMX4e/WPJMryPb+rH67XA5Od9SzEOR2duRw6FiFIpLzu9yBMv1FkKnz4SwHHwYtoh9Bqc6vYq9ZiWtOvtCgBt41baMD1lPp0u6ayrM4gRXsSDhMaoQ4chEskUA0c72RJD5+5IC9eNpgt+v8pbTcIM0vLnWxMRli3PM1vpAm85Q8cs/RX6YOi+odzepNgveg8Q+H/4UvlJDKfYUedD1TPUPIUsZOWdj6e6IL3ZIiXCURdPpvECyL5qKcEYE/1lAL2hdmKKt2klevaD/iasAVjCCohcniPTSC5deSJA3SRjN4njGC9k8flsRmB4ORlyifC2+mf734Zgv8NgraJKQhdzhognAIMX2AM3K6/YEDFbvep5dwtsO7UxIVyOjlmw5qxtUbfp5+Gh1RENM4HLsxakDo7UaDiyKs+MA4+AKsBCi8aqypKmk9k5fivNNc8Eg65tmwSsMcoiKRl8cPcFEkST/sPW4AjoiWA3MJjTXyEKNhqj/EZwyQZwDOQyyI1zqQCGFvXLO6JiMQrs+4fccu+NgM6oRf0Ep0+F0YfZFLOPECN0t2dJXmuPb66mAOtIkqvLht23E8MjnETOSOtFd73atmegME0s16myhLbihvCKOOJw8ZmRq2HefL0F1L7X4lnASl1sPyUa3weSpd+DWNRnCSJ60GNL9bLLfxyofQViAO/ZYPJuokLDk08O5D+hXBy2ecNGeygH0vp7Wqh+h6eXnrZ+kbJ9ci8PdSB/jPN/T+jdWysNQHtdPblGSLk3BKGmJSEjzWv4obLzeA4eZvO1aflQ3CGig7WmDWaOcbJQJ17KNa/iQLVwNCaABd0vfCGf7pB9O1rh4SwqW2pTdQRVhvv6oTSVrFM3W+RcM4Tq+g81ceb74SnZ5GLfCiFMP5DFKHigvQIoTE59Js35i08gFu+n3K6/XUQUMv2S/V4I0I7vbrJlOohQFRE oeuGtkbR IgGr/ZgBgj/nYqYJ2RRS85dOUKRDrjBE5vsQUv0uFq0Qf6nDAReaPOCz2FeYwaeAPtc1BbQCZ2DTw4mmijqpnvdPv6BxmZUbnnA7kTTB3xQk180MZCXRku1H9Hl3Rz9CjsUyaUmFVDtpf4ztHba/gCzJfVOUKZfCqVDWDVfqAAjrbcJKhbq26JOfKPJRLW4AnTiab 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 1d0ca2a2776d..631e83eee5a1 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 ab387ea66365..13fff8f7832b 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); int folio_expected_refs(struct address_space *mapping, struct folio *folio); diff --git a/mm/migrate.c b/mm/migrate.c index 097d67c82f8b..d5c1b1542335 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -643,13 +643,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 ***********************************************************/