Message ID | 20240424135929.2847185-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 D75B3C10F15 for <linux-mm@archiver.kernel.org>; Wed, 24 Apr 2024 13:59:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C09BF8D0015; Wed, 24 Apr 2024 09:59:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9E23B8D0001; Wed, 24 Apr 2024 09:59:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7E8148D0001; Wed, 24 Apr 2024 09:59:43 -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 5045B8D0011 for <linux-mm@kvack.org>; Wed, 24 Apr 2024 09:59:43 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 04ED31C16EE for <linux-mm@kvack.org>; Wed, 24 Apr 2024 13:59:42 +0000 (UTC) X-FDA: 82044583446.11.5257B8E Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf18.hostedemail.com (Postfix) with ESMTP id D41891C000F; Wed, 24 Apr 2024 13:59:38 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=none; spf=pass (imf18.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=1713967180; a=rsa-sha256; cv=none; b=YvltvAr98Ybo08HEarZAhEmnfwbRogvOsBRxGBkdKHdj0JPYhCqgoxVDw2E3mja5askP43 orB8n3R5663QPG104j6sTlg7KFLkspQUOdzLhOO0FuctHg/OO6DWe+8GtJU0Kqw6dCYVbT 8KR4zRKtqnQSn9VTwGNOlS2dAUWfAoM= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; spf=pass (imf18.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=1713967180; 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=Vu1YiVu6PQ5uFxuNgUVhOf6cPkfOX5wbV6cSCZY4a4Y=; b=RWcJ8oK/ima2xoHXlXOsrUe0yr/BwWd4rRPXp2vl4mx4/20Ytki5YjuFvo/MeEnIv5Ba4s 5OxhKNXRC2vTXNPOsgriTW6FkoS9NDMZX+wQh0VX9PtxOsanVgwaMhAn0Fx9FAY4GpH37k YJkGfIPB2URHaEMCZbFhe6Pxl6jSXEY= Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4VPgYx5036zShf3; Wed, 24 Apr 2024 21:58:29 +0800 (CST) Received: from dggpemm100001.china.huawei.com (unknown [7.185.36.93]) by mail.maildlp.com (Postfix) with ESMTPS id 58825180080; Wed, 24 Apr 2024 21:59:34 +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:33 +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>, Miaohe Lin <linmiaohe@huawei.com>, Naoya Horiguchi <nao.horiguchi@gmail.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>, Zi Yan <ziy@nvidia.com>, Jiaqi Yan <jiaqiyan@google.com>, Hugh Dickins <hughd@google.com>, Vishal Moola <vishal.moola@gmail.com>, Kefeng Wang <wangkefeng.wang@huawei.com> Subject: [PATCH v2 01/10] mm: migrate: simplify __buffer_migrate_folio() Date: Wed, 24 Apr 2024 21:59:20 +0800 Message-ID: <20240424135929.2847185-2-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 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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-Server: rspam09 X-Rspamd-Queue-Id: D41891C000F X-Stat-Signature: 8t4dausmh647hsb8ohfnhn78na57js1j X-Rspam-User: X-HE-Tag: 1713967178-440835 X-HE-Meta: U2FsdGVkX199092zkML4ByyQkeXOu2fXCzQ1vQAotcVR+T7HXNyVyWsM17WWYAEzxeA9LjhY4lM++tYW+hR+2256Y7/u7Lw46UEh/tTyWpqHERxhX+szAYqPSXZLadxmd6cdaSUsqqtgVLQMXC3kCTRdcIzczjZFDW2Kwb/KXOlNNPfW6CEQU9FSG5TVEIYxNVG5ibXpjF1jqKBAtNsh0rdfcWrc7+FDaEnWJA0q13ZxYJuTDh/qf7/WQINADUnBePsDg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MBpRT0oe 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 4fbc7ff39da3..9cc5a3e1d97c 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -803,24 +803,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);