Message ID | 20240206112134.1479464-2-wangkefeng.wang@huawei.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 53FBCC48297 for <linux-mm@archiver.kernel.org>; Tue, 6 Feb 2024 11:21:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A3DCA6B0082; Tue, 6 Feb 2024 06:21:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 99E496B007D; Tue, 6 Feb 2024 06:21:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 692F56B0092; Tue, 6 Feb 2024 06:21:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 1930C6B0080 for <linux-mm@kvack.org>; Tue, 6 Feb 2024 06:21:52 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id A3EE3C0BB1 for <linux-mm@kvack.org>; Tue, 6 Feb 2024 11:21:51 +0000 (UTC) X-FDA: 81761139222.22.35FB0AA Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by imf09.hostedemail.com (Postfix) with ESMTP id 8F451140034; Tue, 6 Feb 2024 11:21:47 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf09.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.190 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707218509; a=rsa-sha256; cv=none; b=HAjySQNjzu4tnV1sURV0ctj2ted/WYZdHE65p9n025Z12vmrWlgQoSUiLWVZ41WZ5IptYv jYuZiaa7N7YBiOnFxyRRrmx0cZRLP23FsuKCa7ygt70aLRhjQyqcoaErPreuYywM9uev1A SAHzzqxWzY+nCwHNb9WOGe3nZZ1qYrE= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf09.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.190 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707218509; 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=Bt7+CuCqnfd1TP8GqRcil80sudyLnihTTipPIF8jbCU=; b=GHfo4iUYjUqDSxnliiMvcdZz4pvq0wE9sDndPFEP72PbDSxxXsrhLE2FptAtOAZ1mdtIW6 AVbkEnQ5CzbLx5H3vmzaluxPBE7sps8Mh9iDEABaX7IH3pafJ8AkT4tNvA5Ukwa5bqdpXP DFu3brDVP9BSJKk3LHQ1SKQ0yKPyh6Q= Received: from mail.maildlp.com (unknown [172.19.163.44]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4TTgkq3gvWz29lQy; Tue, 6 Feb 2024 19:19:47 +0800 (CST) Received: from dggpemm100001.china.huawei.com (unknown [7.185.36.93]) by mail.maildlp.com (Postfix) with ESMTPS id 4145C140412; Tue, 6 Feb 2024 19:21:43 +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; Tue, 6 Feb 2024 19:21:42 +0800 From: Kefeng Wang <wangkefeng.wang@huawei.com> To: Andrew Morton <akpm@linux-foundation.org>, <linux-mm@kvack.org> CC: Tony Luck <tony.luck@intel.com>, Naoya Horiguchi <naoya.horiguchi@nec.com>, Miaohe Lin <linmiaohe@huawei.com>, Matthew Wilcox <willy@infradead.org>, David Hildenbrand <david@redhat.com>, Muchun Song <muchun.song@linux.dev>, Benjamin LaHaise <bcrl@kvack.org>, <jglisse@redhat.com>, <linux-aio@kvack.org>, <linux-fsdevel@vger.kernel.org>, Kefeng Wang <wangkefeng.wang@huawei.com> Subject: [PATCH rfcv2 01/11] mm: migrate: simplify __buffer_migrate_folio() Date: Tue, 6 Feb 2024 19:21:24 +0800 Message-ID: <20240206112134.1479464-2-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240206112134.1479464-1-wangkefeng.wang@huawei.com> References: <20240206112134.1479464-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 8F451140034 X-Stat-Signature: iz7ez7smj3b8bwmiamgnnpiqm461sz5h X-Rspam-User: X-HE-Tag: 1707218507-253386 X-HE-Meta: U2FsdGVkX1+IjPABA5t8hTin7DkS1zhZhGV+UKvbrW9L8Qivm6DsW/VK5muY+sxa1qy6vd8a/71D2VA/2tE0E1MAL2TgYsRDp2/EJ7H6qliYBAQ2u1L2W/s1ng1dzNaohMU3Xp1iAsc1DcWLyuf+KuLEudE4qThqUGcv1iU2FQE580irYgpcz0I0ZJMYQPLePNbW8IbQIQhAp/WbH+VAWXMnmXSnp8l9PQ9goa/Cx8R3QaSKjjkj+DRHlGRKlGAYLespUAM/aJs8P0sZWkdpZf/UpSZBesy4UvYN8+0SuXpdJMP7G6f5IqTAn6awaFBGIGHTGzkij9apwoRzQXEUfVgha+8kaG/MJ6Ex5NjgYrdPzZ9rjvtwVnsWBtWEc/IlttQuoTeSDEIHHc6+fjL/7YeaU0j+04FYwDrRF1LXaFCI/qr86a5O9fYRrc0kwT4CzFyfJGSxLrUtw1TIlcMzdgifLbhfd5iq1yneOIYiv7G+bqcJy+NgWWLraccgCuoyrtoClmwoSPqmA76z1lEhmrAZC0mALl2wK6OgcOsBvsXoLLox2ZHuEJPU9phnAWjEUv3yBdKPEneEN+HmoiswynSbvJ7c475HOQ26jIW3gyLYnHdsCVq447DHwcauei8atQRfncwla45twRmN40f0yOSn21lFGXoZnpJlYLWwrAUrHZSyAZ6KmadCUoIIF+FC9b19WRcMcEZ5FPK5gOCsLH8EcUB+0xCTmxiQPiBiIsonOJ1zL7+7rDTxxJPlA55YYoFSE+y00C3c/nqJa/XlB2TxqvMbWvbo0FWxwPTN2TtgK1ey8eax7oRxoEFHswAp47fi9k39qjkNBdM4YXrr4G5Ep8azvzviZ5BXVG42P2ipqg1w6BslylvtWRutgMxbkXDjnr0rSejHTn8Bpe9IHnBb9kYmrVq2YrP+F8SFwFUY9wQstxWevhH+9TXxTv70v46rpvBrqaQA7ucqNvk ytl7vuN3 Yo2utunHJhKQ9coFviMBbASCLWqChan4T5JjmtdMSx+Rl40AmDDo4G02ULmYdaeEjZXfkFscrl5fEMm0Fvw8P1S+DUqp8oKtxM2VdvLBGSaE0dMCDX8a0ca5cwZhW5QB+Wp7UuGkPjcQN+JEs1peR2rkpTdd/PAZz+wOT/tJjWSoGvl3UQgTnOPvUoEAiSqAEv4IbtDZpVEL719wWa8ahvevnULemeh2pVbE7xK04y/nW2DJbPDwQKYcgLUa8DOeF5iG7 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
mm: migrate: support poison recover from migrate folio
|
expand
|
diff --git a/mm/migrate.c b/mm/migrate.c index cc9f2bcd73b4..cdae25b7105f 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -774,24 +774,16 @@ static int __buffer_migrate_folio(struct address_space *mapping, } } - rc = folio_migrate_mapping(mapping, dst, src, 0); + rc = filemap_migrate_folio(mapping, dst, src, mode); if (rc != MIGRATEPAGE_SUCCESS) goto unlock_buffers; - folio_attach_private(dst, folio_detach_private(src)); - bh = head; do { folio_set_bh(bh, dst, bh_offset(bh)); bh = bh->b_this_page; } while (bh != head); - if (mode != MIGRATE_SYNC_NO_COPY) - folio_migrate_copy(dst, src); - else - folio_migrate_flags(dst, src); - - rc = MIGRATEPAGE_SUCCESS; unlock_buffers: if (check_refs) spin_unlock(&mapping->i_private_lock);