From patchwork Tue May 31 12:25:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12865495 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 902B8C433EF for ; Tue, 31 May 2022 12:25:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DDF116B0072; Tue, 31 May 2022 08:25:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D8C586B0073; Tue, 31 May 2022 08:25:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CA12E6B0074; Tue, 31 May 2022 08:25:25 -0400 (EDT) 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 BA8406B0072 for ; Tue, 31 May 2022 08:25:25 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 825C834E2C for ; Tue, 31 May 2022 12:25:25 +0000 (UTC) X-FDA: 79525958610.12.9057294 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf07.hostedemail.com (Postfix) with ESMTP id 485F24004F for ; Tue, 31 May 2022 12:25:12 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4LCBKq2FmJzjXDN; Tue, 31 May 2022 20:24:31 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 31 May 2022 20:25:20 +0800 From: Miaohe Lin To: CC: , , Subject: [PATCH] mm/migrate: skip unsupported ZONE_DEVICE page in migrate_vma_collect_pmd() Date: Tue, 31 May 2022 20:25:30 +0800 Message-ID: <20220531122530.17996-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 485F24004F X-Stat-Signature: z1ggcbm45dnf8dy3tti6hxthwgzcisip Authentication-Results: imf07.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf07.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-HE-Tag: 1653999912-829879 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: For now we only support migrating to un-addressable device memory. Other types of ZONE_DEVICE pages are not supported yet. So skip those pages in MIGRATE_VMA_SELECT_SYSTEM case to save useless effort. Signed-off-by: Miaohe Lin --- mm/migrate_device.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mm/migrate_device.c b/mm/migrate_device.c index 5052093d0262..a0452c1d69dd 100644 --- a/mm/migrate_device.c +++ b/mm/migrate_device.c @@ -157,6 +157,11 @@ static int migrate_vma_collect_pmd(pmd_t *pmdp, goto next; } page = vm_normal_page(migrate->vma, addr, pte); + /* + * Other types of ZONE_DEVICE page are not supported. + */ + if (page && is_zone_device_page(page)) + goto next; mpfn = migrate_pfn(pfn) | MIGRATE_PFN_MIGRATE; mpfn |= pte_write(pte) ? MIGRATE_PFN_WRITE : 0; }