From patchwork Fri May 24 05:28:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13672719 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 827ECC25B74 for ; Fri, 24 May 2024 05:29:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 959896B0085; Fri, 24 May 2024 01:29:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 909A96B0088; Fri, 24 May 2024 01:29:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7D0AB6B008A; Fri, 24 May 2024 01:29:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 548E16B0085 for ; Fri, 24 May 2024 01:29:22 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 08B0D1A08B5 for ; Fri, 24 May 2024 05:29:22 +0000 (UTC) X-FDA: 82152161364.11.6568245 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf26.hostedemail.com (Postfix) with ESMTP id 52745140002; Fri, 24 May 2024 05:29:17 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=none; spf=pass (imf26.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 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=1716528560; a=rsa-sha256; cv=none; b=EEa7PEsextq9E1pesZRe2acClxefyEE6VNdqDlDZhsciQ+R99gNo1hnOefqdQwKB0JHdXj OAuggBxgHMvFn2pJg5CQlms7hbgVtuiQcmMS62ZgBPTqzREm7XMyeqhK90/HmPDxzOznLy kgJgBKbrLTukpq0BTwcZ3IC8+CrXuIQ= 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.187 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=1716528560; 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: references; bh=0FsrjmdcJmFi4MIuxMXH4VUqGWsdxAlDnQDca5C8Pyo=; b=Y6UyMDuzOmb4gT4+xvvM7QYDN4SfM8SSacF/jKHv9dNtADkA5r1nX7R7TS1mRx3HwlFiRa DT/iav2ImoEoHYJ3e04ZTCcSP/63p135qneQq8K+FixVHb6lZuLTsdF0Dh1luqJPumyg41 TNHeMR5eywp6m9+J85amIXyLNdbDpXQ= Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4VltmB4hkYzxPks; Fri, 24 May 2024 13:25:30 +0800 (CST) Received: from dggpemm100001.china.huawei.com (unknown [7.185.36.93]) by mail.maildlp.com (Postfix) with ESMTPS id 0F09C18007E; Fri, 24 May 2024 13:29:14 +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; Fri, 24 May 2024 13:29:13 +0800 From: Kefeng Wang To: , CC: Tony Luck , Miaohe Lin , , Matthew Wilcox , David Hildenbrand , Muchun Song , Benjamin LaHaise , , Zi Yan , Jiaqi Yan , Hugh Dickins , Vishal Moola , Alistair Popple , Kefeng Wang Subject: [PATCH 0/5] mm: cleanup MIGRATE_SYNC_NO_COPY mode Date: Fri, 24 May 2024 13:28:38 +0800 Message-ID: <20240524052843.182275-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm100001.china.huawei.com (7.185.36.93) X-Rspamd-Queue-Id: 52745140002 X-Rspam-User: X-Rspamd-Server: rspam12 X-Stat-Signature: xjs8u6889jsng1fnu9g69kkpd4pp5f14 X-HE-Tag: 1716528557-910336 X-HE-Meta: U2FsdGVkX18EhKHMO7SM3MvNBCkm7G2LkIYFxP3IsHkcM6XKdJ8KEEwrCSBS7/q0CNUfe9FDpgYBaMT8gVjovxsam6W10ebRWoosA5tyWCmKWwtH3vBk+w/jlPT8SL6DtGJg2lZpETtLGvUef68+eDgwrLNDK9fV23P+UFe1a756ZhCDKwMJ3jNs8i1qPq5HsN6o2RLcD1CcJ0ok2m5/t8o250/3IRn/Yia+GHeTojlKiMPwjLXoO39x77uUAsTHbGDPkN2f5H6VXEhK16kkLx5bFX5MvJxDdxH8svmSUb/PlxwoNaLhGd4uRyHO+Sm9eBJhVrHGDMPu16+8rjHYkIzTED0r3MY7REgO8hzrDqMtKh8M1eVMH9atZfW4HAyyOrBNvzO/NaNuRVOxxDOYTuqFxWhzucU1PiGpJbztffvZf4nd2BdUc+lxDknJfWZZ6SQH7tsAz4iAh+pJZ4qYZ9Spy4h/gt8pN3P3jGJE/9LupxMcse+eeMRRrReSSNl56YdM1UkUfPM/dT5enGCqx6e0R1UAmGFiYkgoXHXGCUvb7nqed2rQci013Yd0MOr/VTm/yBHPDATiMShAs8zEzLCr0fO4IaFsNMlq48iiviYOH7II5GlorpuZMszv0al/3RCIIUpnahjhFXHjf76srE9cVsg9gkMDvXfJzskZWeAs+sHCFqx2WxpSaqzgX75ed8I+xoDE+/gbgKD9KBk3gdumObs5xGZR2eby80rWjSelM4l+SyvMr2WAfspnaYvp7C5+PxoTfnFFYaYCRxjsxwBGXlygssFksv95xp2G1Z6tTNNv3EhKBmAB59J9HLUtOJs0vuV4/cXw3DRZASC96tWZsvD3uqZcVmK76TIgh60K3ZF+uYISJRH1vZTNsPJBfRvSdx0voJj4eKTCtsW4YpxnvnkiL1CqsaMUjRcYSNetPGUD5j9lUEythpq+NLb7ldtA+vNI86ztxJ60nBQ QlXin4po 64COC5rX0+eIeu0U+qWVk9eX0DIpgt8kQ6SnIvayeQFDfwkBZtqHuaGKEtUt4WMuxyxYfsI8xDSMntSP9GOnGLleYLHJQD7ynnIOKhyn/nltDahfrhDxeGryNfmVpIrBwW6jSa74qJjREo/7zabm9QQ4L8Lw6ocVjx3IPSoRc4ItKbR6lE8ttSw/2/HwLmvd8biCZEoPoDXWKyXN4QJ3s/v5uejDXmnddzf/NFyIEYWTGQZabwiuZbxKq5J/Yd0nE1k3x5Gg4jl2io39QkD2yGEMQTsURMcKSpZKqNe/vi+SgAHCERShb7J5k8IKGaz9gTzxJ 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: Commit 2916ecc0f9d4 ("mm/migrate: new migrate mode MIGRATE_SYNC_NO_COPY") introduce a new MIGRATE_SYNC_NO_COPY mode to allow to offload the copy to a device DMA engine, which is only used __migrate_device_pages() to decide whether or not copy the old page, and the MIGRATE_SYNC_NO_COPY mode only used in hmm, a easy way is just to call the folio_migrate_mapping() and folio_migrate_flags(), which help to remove the MIGRATE_SYNC_NO_COPY mode. --- This is splitted from "mm: migrate: support poison recover from migrate folio"[1] to make it easier review and hope it merged firstly since no more comment for a long time, rebase on next-20240523 and only patch2 changed a bit due to commit e18a9faf06c2. [1] https://lore.kernel.org/linux-mm/20240424135929.2847185-9-wangkefeng.wang@huawei.com/ Kefeng Wang (5): mm: migrate: simplify __buffer_migrate_folio() mm: migrate_device: use a newfolio in __migrate_device_pages() mm: migrate_device: unify migrate folio for MIGRATE_SYNC_NO_COPY mm: migrate: remove migrate_folio_extra() mm: remove MIGRATE_SYNC_NO_COPY mode fs/aio.c | 12 +-------- fs/hugetlbfs/inode.c | 5 +--- include/linux/migrate.h | 2 -- include/linux/migrate_mode.h | 5 ---- mm/balloon_compaction.c | 8 ------ mm/migrate.c | 51 +++++++++--------------------------- mm/migrate_device.c | 22 +++++++++------- mm/zsmalloc.c | 8 ------ 8 files changed, 27 insertions(+), 86 deletions(-)