From nobody Tue Apr 28 17:04:48 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9F16C433F5 for ; Tue, 31 May 2022 12:25:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344204AbiEaMZ2 (ORCPT ); Tue, 31 May 2022 08:25:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232616AbiEaMZX (ORCPT ); Tue, 31 May 2022 08:25:23 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F09D665406 for ; Tue, 31 May 2022 05:25:22 -0700 (PDT) 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 Content-Transfer-Encoding: quoted-printable 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 =3D 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 =3D migrate_pfn(pfn) | MIGRATE_PFN_MIGRATE; mpfn |=3D pte_write(pte) ? MIGRATE_PFN_WRITE : 0; } --=20 2.23.0