Message ID | 20210607204226.7743-7-alex.sierra@amd.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=eTUP=LB=kvack.org=owner-linux-mm@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8B74C48BCD for <linux-mm@archiver.kernel.org>; Mon, 7 Jun 2021 20:58:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6666C6100B for <linux-mm@archiver.kernel.org>; Mon, 7 Jun 2021 20:58:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6666C6100B Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 090246B006C; Mon, 7 Jun 2021 16:58:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 067596B0071; Mon, 7 Jun 2021 16:58:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E23746B0072; Mon, 7 Jun 2021 16:58:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0113.hostedemail.com [216.40.44.113]) by kanga.kvack.org (Postfix) with ESMTP id B3E2A6B006C for <linux-mm@kvack.org>; Mon, 7 Jun 2021 16:58:51 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 5A474180AD802 for <linux-mm@kvack.org>; Mon, 7 Jun 2021 20:58:51 +0000 (UTC) X-FDA: 78228142062.14.78CAC6D Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2077.outbound.protection.outlook.com [40.107.94.77]) by imf05.hostedemail.com (Postfix) with ESMTP id AA778E000838 for <linux-mm@kvack.org>; Mon, 7 Jun 2021 20:58:41 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hs8tsUdwCq2DUDTKbV3qHLz1o5I1Ezfs3KmD/xzfyi0U5fcM2EQH1sRy1HXXT0qcJJZAQS21CULSI7yGrOokSn6XFwM4P0UJaOZJbxHjQaW0v+eeyZLb8jRJHea97JILAMEWUObx3hjpcD197oFO3z7Le9aAyqbC2cVNtxFNyslEgkdiFoFxo720eoXr6tkbo2J4nDbwNepXA7t7ofHGIU9l5fQzw+OvH72HCghYwCcuzvKziwycuR9JjuCyHnPiZhNBUhyXQnaX/ZhRWZhq17Av5kJX4NG6bzVq2HPEnHVoQ1BdbQBKsQQShDbi52wqt8UPkaodeUnmNuXm0DFoRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IBCtJUn76duHlCF8zpr+2pt1DTLoFbBMMCEIW6lwquQ=; b=BmK3WnsBx01C5PGjvI8BtYTEJJwiuaNStDmUhc0Wvmoe5Qe+vkWPw+Rwq1nWG9VEcsAWoXIE0xzBu8nizcyzB3OcKxs4msXosj9TzbK0Wqq2Utnkl+JwA1Zm8F/LENirn9owWXopl+s1Ci04oWUTedVAowCLoz37MUEX9kGqac73qRbaI4rZt8ztugN2YyZOjFWDqLdudRh7bo8dLvoNd8q9Q96ovC148lNd7RcOOqCDDHoVnCo7OtsusdFMk8FLwBei5ZHlwmfCC6JngyyFsb/5sD3GdHVOLRFaBhBijeEMWJxphAKMHPnKF2V4q4rZlIXDTGcu5it4/8kvWo5BpQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IBCtJUn76duHlCF8zpr+2pt1DTLoFbBMMCEIW6lwquQ=; b=qw/TfNye3OxbcwvnTDPodg+FYTPG/oMKJsqFBh1XaKZF7Tm6axPqLSPuH5CewglpTT39+PwVyi4UTK2w8PZmIw7zuroWeB7dVFv69NFEWJAL1eqaSNb5UIB/ZeTW4IsvKOgJVR9ny2cZ1q66gGyxn9kdXlafBdu+HhnM1RNKrmU= Received: from SA0PR12MB4430.namprd12.prod.outlook.com (2603:10b6:806:70::20) by SA0PR12MB4495.namprd12.prod.outlook.com (2603:10b6:806:70::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.20; Mon, 7 Jun 2021 20:42:43 +0000 Received: from SA0PR12MB4430.namprd12.prod.outlook.com ([fe80::5ce6:fed4:e00f:27e4]) by SA0PR12MB4430.namprd12.prod.outlook.com ([fe80::5ce6:fed4:e00f:27e4%5]) with mapi id 15.20.4195.030; Mon, 7 Jun 2021 20:42:43 +0000 From: Alex Sierra <alex.sierra@amd.com> To: akpm@linux-foundation.org, Felix.Kuehling@amd.com, linux-mm@kvack.org, rcampbell@nvidia.com Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, hch@lst.de, jgg@nvidia.com, jglisse@redhat.com Subject: [RFC PATCH v2 6/8] include/linux/mm.h: helpers to check zone device generic type Date: Mon, 7 Jun 2021 15:42:24 -0500 Message-Id: <20210607204226.7743-7-alex.sierra@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210607204226.7743-1-alex.sierra@amd.com> References: <20210607204226.7743-1-alex.sierra@amd.com> Content-Type: text/plain X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: SN4PR0601CA0018.namprd06.prod.outlook.com (2603:10b6:803:2f::28) To SA0PR12MB4430.namprd12.prod.outlook.com (2603:10b6:806:70::20) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from alex-MS-7B09.amd.com (165.204.78.1) by SN4PR0601CA0018.namprd06.prod.outlook.com (2603:10b6:803:2f::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.22 via Frontend Transport; Mon, 7 Jun 2021 20:42:43 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bb5ea137-028a-483b-dd36-08d929f4ccd1 X-MS-TrafficTypeDiagnostic: SA0PR12MB4495: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: <SA0PR12MB4495F66CDCDA3952804FA542FD389@SA0PR12MB4495.namprd12.prod.outlook.com> X-MS-Oob-TLC-OOBClassifiers: OLM:156; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0301Scu4T6QGZeANeVnaTlREaZohn7HtvaTwIhsQ9HuQbi71sOZK/DBaOgQJExIlgJVCHhWMKRqxOKPfj1lP+w1fkSBUYVEe+yMZIctFm+4iTgW3ZhVhDWj4iZa0ZqSBLN6Qbt8WkSOpawe3gFnuZTLSzVL+/BB6rzirufbl6dqrf8guXbVt6eRuDKvj9yyEspwb1aWA2LoZuOGBfukzLkoMBNP90lif/iSZMZKZ0M9pxmREeAxKmo60ToCn70Bxn3qLA6Bs9iwKoIaGKRO7Ti5gx1Z2Qt/HtQw3aiU35xORMKg/GTBZItJTOOzQSUSqGefbefXRaSdNrnDG08263ZcAWZaLtN2L5n9h6TNBrNQypaUxKzOrMytM27Ybkjz5jiQnqVQiZiTBpkJIqNFfGW/6QbfqUGiXSEaI5lgx8Y/5wv9SpeUk9JxJacWNHZJnFNRkm663Vuew6BFvBnl2TvkMBWxWaBmBYMHdVYecUahI0i5n4SGQ/77dxoPIeP68qFDx9C67irvVdaTSwvUGLYIbHOtZKIJEKcb4Zy5EuetFdoGyN2UsCL6ngEHvT7rPsBOAvGJZQQ10HfTuULHiHCcxi49SLyocgaMZJaHHG6ynuHd26lFWnkCluEdEkvewwoK7/wKyt7WSka9sj94GKLz7h4cu1J2UZNHPwKx30u8J7wL9ikmvl91n5nznY70x X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA0PR12MB4430.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(136003)(346002)(366004)(39860400002)(396003)(956004)(2616005)(4744005)(6666004)(38100700002)(316002)(26005)(5660300002)(1076003)(2906002)(6486002)(66556008)(66476007)(186003)(4326008)(16526019)(66946007)(44832011)(52116002)(7696005)(478600001)(36756003)(8676002)(38350700002)(86362001)(8936002)(41533002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: y7tPIf8D2KCUAHgm2yzF92Hf7oEACHcLP+GBAsGKbIH/E3sSBAG1MaW9zLMpa27deE4H9OzeWJL2wUd+p0fkITuVpRPDYZnk0b9Sh/WFaKIPHP9H+6GIZx6mlP6SMR2Pz++ssolinAiBpL2ewrfSVibQNPTHVUlaUQWcxxicsByYxiTTmmyo2uXaFWVOd11WAUvStmrRqbgLncEwXJF5v7ssd6Bsn1Itp58o0goMx6qVEkysAiLpCwveOcUhbq+gEsJETP2dnnUOB8QDEeDqzkE53i4qfBKGJP955Dl93TLh+77/uTHgylvW5slXFYXvqRHC/w/T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f4ccd1 X-MS-Exchange-CrossTenant-AuthSource: SA0PR12MB4430.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2021 20:42:43.5825 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jTsbg1DRDakzjUoltl07w7kGltAvRtMHCC9Y5EIV0FwN17lueP/Yr+iDs9B7ViOQsUBSCSMWXkOHAoOIGQ8GBQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4495 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: AA778E000838 X-Stat-Signature: ceh4i9b6um733ry4iqpsjpryx5pons1j Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b="qw/TfNye"; dmarc=pass (policy=quarantine) header.from=amd.com; spf=pass (imf05.hostedemail.com: domain of Alex.Sierra@amd.com designates 40.107.94.77 as permitted sender) smtp.mailfrom=Alex.Sierra@amd.com X-HE-Tag: 1623099521-62659 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000090, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
Support DEVICE_GENERIC memory in migrate_vma_*
|
expand
|
diff --git a/include/linux/mm.h b/include/linux/mm.h index d8d79bb94be8..f5b247a63044 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1125,6 +1125,14 @@ static inline bool is_device_private_page(const struct page *page) page->pgmap->type == MEMORY_DEVICE_PRIVATE; } +static inline bool is_device_page(const struct page *page) +{ + return IS_ENABLED(CONFIG_DEV_PAGEMAP_OPS) && + is_zone_device_page(page) && + (page->pgmap->type == MEMORY_DEVICE_PRIVATE || + page->pgmap->type == MEMORY_DEVICE_GENERIC); +} + static inline bool is_pci_p2pdma_page(const struct page *page) { return IS_ENABLED(CONFIG_DEV_PAGEMAP_OPS) &&
Two helpers added. One checks if zone device page is generic type. The other if page is either private or generic type. Signed-off-by: Alex Sierra <alex.sierra@amd.com> --- include/linux/mm.h | 8 ++++++++ 1 file changed, 8 insertions(+)