Message ID | 20210717192135.9030-6-alex.sierra@amd.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <SRS0=bdLU=MJ=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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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=ham 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 176BAC636C9 for <linux-mm@archiver.kernel.org>; Sat, 17 Jul 2021 19:22:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A59136115B for <linux-mm@archiver.kernel.org>; Sat, 17 Jul 2021 19:22:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A59136115B 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 7546F8D00F9; Sat, 17 Jul 2021 15:22:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 72A998D00F5; Sat, 17 Jul 2021 15:22:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E18B8D00F9; Sat, 17 Jul 2021 15:22:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0076.hostedemail.com [216.40.44.76]) by kanga.kvack.org (Postfix) with ESMTP id 2DB1F8D00F5 for <linux-mm@kvack.org>; Sat, 17 Jul 2021 15:22:00 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id E043122BF1 for <linux-mm@kvack.org>; Sat, 17 Jul 2021 19:21:58 +0000 (UTC) X-FDA: 78373049916.25.971B403 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2088.outbound.protection.outlook.com [40.107.212.88]) by imf26.hostedemail.com (Postfix) with ESMTP id 7BB0B2001714 for <linux-mm@kvack.org>; Sat, 17 Jul 2021 19:21:58 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N7WvIgMWzlhLFDjL2I1n5wSyyUZwvmqgZEucFBO9gx/dHh+53tZ6kHiJqgRIiOYY33w9JFwQwsDk9SJSsB2qpgg4lHpu6UeHCRlhHOhc8ff1H73Dw4o3DxtxVOh48ECFqu59UpG+f6cRmh9h+s973Tu3V4+2LFWTEoEuoc1T/scklkOM9qHvHMsa7YkpqmgoVIA26eIAQZ8crXVrDt+1XZeeK+mE00E2MJFiFV1e+liTuDsuURPoVwRBqtfq1XhyxTwZ2LPqPONGfaKp3Wg+zYaCeyw8R/XgrTlc4ofC8hpioXxExEwtM9cFSrBl9QbS1pYNDvETWT2krIiDnhDxOQ== 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=f2ckaEYhYH5EBOREpxdvq67kPzy/ubBjQwHjl/1feIE=; b=mCa56c8Cdshcx8FNTbNnXmc0rACFqWimefgOcTj7X3XocFxTqCvgk4QbZr6aGBHPRYbkDplzcCqzFxGr/RYK4d4jdxZmeAb1ZBJqe/F8JF5CUwqF86qaiENhRXKb6tkEpw+I/bgpEC0MTrGUQmpS1oWz+Du2Asx4WtGWl6H0PIrMeXaQ4b/KpmDpDACGivjccVfu6q+tsBuXa0bIBC8gJz0rSCP4SB6P4vA8XAE/97/wBOmEq2pGjzy9Aqnr7nfxkG1XSX5K9LM28cOi83lUOKhF56X9fAc1oTBvmxmsRWXcnDsehQYqNZIf8mcA9dgVDV1DFqR7JyB1bco6IyhyDQ== 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=f2ckaEYhYH5EBOREpxdvq67kPzy/ubBjQwHjl/1feIE=; b=i76xfnCh9uQwxCh6GQXmsKi4J91E/6QapwOUhgPTfVhfKU39PW/u1epK8r65r2UT/eZ3Ea6HIKz7CeULzfxqg3hG2FzcbZk+jgSehrp2bKBmZF/bj36v1nIOrbFqrBORiFe4747nsuhqS34izNfeEBchhbi7YoasJcrvkep9Fb4= Received: from SA0PR12MB4430.namprd12.prod.outlook.com (2603:10b6:806:70::20) by SN6PR12MB4670.namprd12.prod.outlook.com (2603:10b6:805:11::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.22; Sat, 17 Jul 2021 19:21:55 +0000 Received: from SA0PR12MB4430.namprd12.prod.outlook.com ([fe80::d0d3:a97e:6b7f:ab39]) by SA0PR12MB4430.namprd12.prod.outlook.com ([fe80::d0d3:a97e:6b7f:ab39%7]) with mapi id 15.20.4331.029; Sat, 17 Jul 2021 19:21:55 +0000 From: Alex Sierra <alex.sierra@amd.com> To: akpm@linux-foundation.org, Felix.Kuehling@amd.com, linux-mm@kvack.org, rcampbell@nvidia.com, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, hch@lst.de, jgg@nvidia.com, jglisse@redhat.com Subject: [PATCH v4 05/13] drm/amdkfd: generic type as sys mem on migration to ram Date: Sat, 17 Jul 2021 14:21:27 -0500 Message-Id: <20210717192135.9030-6-alex.sierra@amd.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210717192135.9030-1-alex.sierra@amd.com> References: <20210717192135.9030-1-alex.sierra@amd.com> Content-Type: text/plain X-ClientProxiedBy: SN4PR0201CA0067.namprd02.prod.outlook.com (2603:10b6:803:20::29) 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 SN4PR0201CA0067.namprd02.prod.outlook.com (2603:10b6:803:20::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.22 via Frontend Transport; Sat, 17 Jul 2021 19:21:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b8f95946-c051-4d78-1d72-08d949581ff6 X-MS-TrafficTypeDiagnostic: SN6PR12MB4670: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: <SN6PR12MB46704007637736B38EACAA93FD109@SN6PR12MB4670.namprd12.prod.outlook.com> X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TGMsnx9RYgioKfhg/oMqvMu3oXZf0cwYcmCwHTZQ6I5yP/Cx+gFXfnlyx6UaItCZHllTShH80ioUD5SHOFA42YyumvoHeXiEmXX5YCJa66RC8WT3qe59CDaTkk2CWvoFAepfOCaSdVD2dZ9tm/jIClvYin9ZumpIq76PldBbKVWsRDsMDQ0ZoqJm0JmMJa7u57Lar4iqhP3MbmKTX/+YjCDE/8NXNgDMNWhZSQMzSuJxw5lPntLmfPHQGj7UQKWWwFVBC3pibE76BwPEPqSJ5e66W6ybHinZZu0lEJH28VGfItsZDZ7lxcmyHzGjRY9dzr7yfqQtJ+VXx9emvgfoBxOZLikNdpU761T615UxmgMyckOnbxvHzp/wIh5YrhYS/4VVtB9GBLotA5vFBlB4+FhOI9gd2U9twqgLprwNAcyxMJHz3f79nKlJ7VO+sKyGDFgaR2+elCC1k9Bj4skpCU58BVHybbbWujLSyy0N4RzPgZUEPLBkbcmF3GRYPgX/NuBRmfYwb227j93nB6H65ZQ7aQdOZAb6iaNDTcJ76eB7FG0/ZLqSeihl70H0Ms01GGU05adWIIpTuztFNBAA44SNEjbde7cG/ljwAzWatpBpk70p2WKm4zF9mTHcIm2SwOMdTmZXOOXsVC/3QPCr3OErSFb2s7SWouSUp9ml/M4yuoGXscpZEYJddUjpBRI+OcmIAUZS3MCOHcH1AU7Zac2LRRVCw3QzitQvtgC5les= 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)(366004)(52116002)(2616005)(26005)(5660300002)(2906002)(7696005)(7416002)(1076003)(4326008)(6486002)(6666004)(186003)(8676002)(956004)(66946007)(86362001)(316002)(36756003)(44832011)(8936002)(38350700002)(38100700002)(66476007)(83380400001)(508600001)(66556008)(41533002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DJ3rMfjwjPLcWxRqUTMtFOHvI/iPm+rdt4KvKiDbLBrsGpL1kIrshuvkVYXNE7UdeYeGonzuCIXfbhimB0OJx4d80S1BbANPAQFxfopzbIfzNOGGiV22WPIK7LNqAQ1HbjlzpaBjxXmboe3hSO2MGPtbyKi4Q8LnYPptLy5Ektr58zF+QKDQkE8No3tZRdauSUwxBgr+qy9jRZf7KeW9aOHEpD8qFcUw+hVdIKpNhrMKba+rj5g2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908xonLsJWNPO1DIb X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: b8f95946-c051-4d78-1d72-08d949581ff6 X-MS-Exchange-CrossTenant-AuthSource: SA0PR12MB4430.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2021 19:21:49.3222 (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: 64p9Vxxf8e2JBsQNgwu1Ae59xSyt6veg3Pi92uDQKHRZcpglyznuMEhmqF+GCEGMuf+iwAB0czSwIZ9NEfNbzA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR12MB4670 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 7BB0B2001714 X-Stat-Signature: 64mwfaa4qnbtx44cqfz6u9yps4hto445 Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=i76xfnCh; spf=pass (imf26.hostedemail.com: domain of Alex.Sierra@amd.com designates 40.107.212.88 as permitted sender) smtp.mailfrom=Alex.Sierra@amd.com; dmarc=pass (policy=quarantine) header.from=amd.com X-HE-Tag: 1626549718-157115 Content-Transfer-Encoding: quoted-printable 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> |
Series |
Support DEVICE_GENERIC memory in migrate_vma_*
|
expand
|
On Sat, Jul 17, 2021 at 02:21:27PM -0500, Alex Sierra wrote: > + migrate.flags = adev->gmc.xgmi.connected_to_cpu ? > + MIGRATE_VMA_SELECT_SYSTEM : MIGRATE_VMA_SELECT_DEVICE_PRIVATE; Please just use a good old if/else to keep the code readable.
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c index 3e9315354ce4..fc491bfc09f4 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c @@ -664,8 +664,9 @@ svm_migrate_vma_to_ram(struct amdgpu_device *adev, struct svm_range *prange, migrate.vma = vma; migrate.start = start; migrate.end = end; - migrate.flags = MIGRATE_VMA_SELECT_DEVICE_PRIVATE; migrate.pgmap_owner = SVM_ADEV_PGMAP_OWNER(adev); + migrate.flags = adev->gmc.xgmi.connected_to_cpu ? + MIGRATE_VMA_SELECT_SYSTEM : MIGRATE_VMA_SELECT_DEVICE_PRIVATE; size = 2 * sizeof(*migrate.src) + sizeof(uint64_t) + sizeof(dma_addr_t); size *= npages;