Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754193AbcK1FtH (ORCPT ); Mon, 28 Nov 2016 00:49:07 -0500 Received: from mail-bl2nam02on0073.outbound.protection.outlook.com ([104.47.38.73]:7796 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751623AbcK1FtA (ORCPT ); Mon, 28 Nov 2016 00:49:00 -0500 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=permerror action=none header.from=amd.com; X-IncomingTopHeaderMarker: OriginalChecksum:;UpperCasedChecksum:;SizeAsReceived:2472;Count:16 Message-ID: <583BC14B.2040809@amd.com> Date: Mon, 28 Nov 2016 13:31:55 +0800 From: zhoucm1 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: =?UTF-8?B?Q2hyaXN0aWFuIEvDtm5pZw==?= , "Haggai Eran" , Jason Gunthorpe , "Yu, Qiang" CC: "linux-rdma@vger.kernel.org" , "linux-nvdimm@lists.01.org" , "Kuehling, Felix" , Serguei Sagalovitch , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "Blinzer, Paul" , "Suthikulpanit, Suravee" , "linux-pci@vger.kernel.org" , "Deucher, Alexander" , Max Gurtovoy , Dan Williams , Logan Gunthorpe , "Sander, Ben" , "Linux-media@vger.kernel.org" Subject: Re: Enabling peer to peer device transactions for PCIe devices References: <20161123190515.GA12146@obsidianresearch.com> <7bc38037-b6ab-943f-59db-6280e16901ab@amd.com> <20161123193228.GC12146@obsidianresearch.com> <20161123203332.GA15062@obsidianresearch.com> <20161123215510.GA16311@obsidianresearch.com> <91d28749-bc64-622f-56a1-26c00e6b462a@deltatee.com> <20161124164249.GD20818@obsidianresearch.com> <3f2d2db3-fb75-2422-2a18-a8497fd5d70e@amd.com> <20161125193252.GC16504@obsidianresearch.com> <0087fba9-7bcb-8bb3-c26e-4ef3e4970c34@amd.com> In-Reply-To: <0087fba9-7bcb-8bb3-c26e-4ef3e4970c34@amd.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.237.74.158] X-IncomingHeaderCount: 16 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(7916002)(2980300002)(428002)(199003)(24454002)(189002)(377454003)(92566002)(7846002)(356003)(7736002)(305945005)(59896002)(626004)(229853002)(93886004)(64126003)(50466002)(6636002)(47776003)(81166006)(39410400001)(38730400001)(39380400001)(39400400001)(83506001)(77096006)(39450400002)(80316001)(6666003)(8676002)(65806001)(65956001)(4326007)(81156014)(2950100002)(2906002)(50986999)(86152002)(8936002)(68736007)(4001350100001)(5001770100001)(76176999)(97736004)(101416001)(6116002)(106466001)(189998001)(3846002)(86362001)(87266999)(65816999)(54356999)(5660300001)(2870700001)(7416002)(105586002)(33656002)(23676002)(36756003)(43062003)(3940600001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR12MB1787;H:SATLEXCHOV02.amd.com;FPR:;SPF:None;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM03FT029;1:EjRiihuV4VdF6PAUqljpAQl61w03osKdxLieV1G49sJpmch8LnpypT8xA8+omvd7GhtR36gnKg3DLAqO0N+3Cb5i1bClfLWAFy3RdgzFWlJGeCOlLq06+6oemnoUn8MI3Mm+mzuFDElDj5beVyaDUdMcAKZAqe9Yadw9ANDEzF5OIAwDWmPEfZVEaC4YlxKA6z4E4DnwvvacfhinSwcreHIQa753jdgkzjAXhndvmOboP1WCRLVbk8QFmv/b9XiVXQPiyO0jiL9Cf5Jaakol6MeLCUIVm12TK0/OSpcDzZbjsZPV/UswDv6SxF4vmFRspdwXDzKZfMXNdyM61TOUqzJu4gpNVp3d7U/DQT9QX9/zo2STe2/2tiTHMqTJUPHERKwJcx/P/Q9YKgl/5tjRtY6dj9ofFijvLWwrp20jvf0rhVqKbIciE3/CCXHj1Xuk1gwVUmVmr1cPXj+rD7hy6LrGuKfiqMd5iH6oL0l172YKq6R28+6C0tZ+Qu3CGK0fYmbqbxjzSDiKISFPxbcvfpec+zV7b8LkuKdCddayK1v6jG0VphvyvKllhtW1qW3D X-MS-Office365-Filtering-Correlation-Id: bee16b17-1d9d-495f-f18a-08d417500f5b X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:DM5PR12MB1787; X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1787;3:Lr8gBj87XVrMvX52+h25KfG5JL/Pb1YHjyyzSZZ4auKtZ4occ0yJuqHfif8lsA04k0KBWBB0wF9t+AEEhQxozYWvyLnnNxp4Vfg1sYYkZHBOb2MHRaivCtufHov6yW8j4Dk2G9GWKMAqKQqOCM/VLKh1qUFpxpykJwbrilyBGKBSBY1FYTLtJfXruJnbu6NWqOEdgZUCsEtgIr5ZX7hm2cYfhM3f6rOAs5iDX5KNccGodfUjThAaBro8U11FQVcAp+u1goY2eKA9BX24Pvg0VnVu4qU/pgA/+dsNTLtQghjQolj6n8dRbiJ6cApdujnOpCZwxuj3/erC/cJ3TysjTjcpdSAR/272M5pXhfuPX5DKO/Gb7QoQZFgOWmc0r4pK;25:j6/7sONUwertHobTz00Wlr/2tFULWb5t7S+vc4upKwQTsmemLz+lMnu+VWnFnsRQF2EG6jYZ3A4j7vZz2RbC5VQVwBi4wGfka7BOqImMCsr9KeEpAxDAqPfbjDXYPtNkd5McPpfPctlLcnQfGsnz4K46bJEYh7Bilz4UyiPQs6dmK+wNC5ZlrM08Xa8ZN8wBj5V/d5zoWJmtLwNAei+WcxMRZBXgiXXSkml9rfdjbWFzorlLBHWnzuWyKzoVfEd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soft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(217544274631240); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6060326)(6040361)(6045199)(601004)(2401047)(13016025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(6061324)(20161123560025)(20161123555025)(20161123564025)(20161123562025);SRVR:DM5PR12MB1787;BCL:0;PCL:0;RULEID:;SRVR:DM5PR12MB1787; X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1787;4:F/K9xnzNs7VHfj9xBmJNEQ1M8rQ/S3aKjMoxF54OB817GgTwuwVf5ag2EVoMqaBCvb8sJLy3Yj7O4urPySBgCrSv0j5S4PnMw9E/gBGhuN/YCwshsZiAZeZiInxdYCR/lMp4INfCriHoLo2pENS6DaQrCLlx5gw0g0P17Uoh9jq5wCk2LPo7VsQgx+1MZN/02F0F7amlGPc712wla0EpkDgEbDtF6pLX8Q8qfsqwPAlSU6j9UxXXdliy56Tnoq/BHj8AfnHXgqMMWAjDl8fhLJCWeFr/sDBShWbZikav3En3hW3Fks1sboOCpvh0nGqnHngI3FKyDD+FjBZF3MXk0KC2bqJfxT2gyAk3hK/KMfBGOTbWKXH/niC0QD+TFxBOAmOKhWDRsRJWiO/Dqjj1qLHKtrUQyoGCvGoFebyq0nfqE3NgQdhLi4WvO7coXM4JIE/6wy5TgfQzm8vYHdyvxEnxVRMgbito1laNCy4JEAYnRUIHmAVVB8BTCPiXy2lxBK3lc6nfrMa7nx/2rBgsqgXi63iHrLcPTuWMT6CMxX28a0Gb1PEoHiptdg1I5vpMqUbklBBx6TpfKkyP9tNHnAswU02fyNswWR6lwH81SQ9pK4qgYxoeZ896M50xiHKcwdNenYJ7McArcmaC8Ky4ij4k2Wcj3RzVwhhIDYqRz6KtF+FAdyt+XpknUa/nPfZTfPPlJvotHyicbnFnyGB+8Q== X-Forefront-PRVS: 01401330D1 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyTUI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kR9ZgXd5MLsVxc+uyuovxTMVcYCSxaKG0R/nfVaQ2BBy0oZK7xuIICmd07tFWPnuzXKohZrsnR55daTrh1LkediBkHN0Th4Vz/owA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1787;7:rvFyqTljPvF/Z3NyZOiy86JXRiu+oM1Zvt8YHzIVMSPVkHsRzXosJ9meU4GQG5zLO+VStGKMGTKbdZy6cdGqBmd1rm1JX8EtvSpbBKj1HYtwoRf5J9NsGtne7XKKnqF1B+YF2BK0jc6fTM/65+coOOBdBCX7e6MYBOqlEranJ8K/Kb4dK/VM8yorXSvbX7JUPqSb3kXV4lV8/oTops0k+OgWlAstsGWSuzYtNOWlSa39NGcnwvDXoP3kzq0lfroVTWPtZosqVuXHK70uv+PbInv3Tz2RQOrEZYZQl2UJmPZ/sQTX+K7hk3wtB16VoBd4XCnvRFxEABJhf9c6wTF+ZftLko18nIwWEr9CW9Dh25BvjhO2EoU7vvsnzzmJK7Pcd/ncV5wdRCyZHmq/nmx23gIbiEBgj+a5E8sjgl6NX5/awh40U55ub473esXZkYoGhGDTBSyE/nWkWEp3zlY5jQ==;20:pd9P4wcqTZcSE7nedunroaSL31N+XLwOlCsmLK47a1jCJXdvWGDYt3s4SDimjxfe5qlX6BrMVlebBaxa749s2ne9nA1NcAftuvdxjOAaUrUKLCHAlm3ya6EiOi4wuy6ljH4dOmzfq6zHo2qFNBXZdHVCSoOA6crZO6h1afQb498PbS3WLyyUZKKLz1jS5C6exunwk05YqZPU8Ce6qjjbkfxM5Wz9OODktm9D0sSgAQF0Vu1i0GGrKKA1kTDPkvc3 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2016 05:33:18.4057 (UTC) X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1787 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2104 Lines: 50 +Qiang, who is working on it. On 2016年11月27日 22:07, Christian König wrote: > Am 27.11.2016 um 15:02 schrieb Haggai Eran: >> On 11/25/2016 9:32 PM, Jason Gunthorpe wrote: >>> On Fri, Nov 25, 2016 at 02:22:17PM +0100, Christian König wrote: >>> >>>>> Like you say below we have to handle short lived in the usual way, >>>>> and >>>>> that covers basically every device except IB MRs, including the >>>>> command queue on a NVMe drive. >>>> Well a problem which wasn't mentioned so far is that while GPUs do >>>> have a >>>> page table to mirror the CPU page table, they usually can't recover >>>> from >>>> page faults. >>>> So what we do is making sure that all memory accessed by the GPU >>>> Jobs stays >>>> in place while those jobs run (pretty much the same pinning you do >>>> for the >>>> DMA). >>> Yes, it is DMA, so this is a valid approach. >>> >>> But, you don't need page faults from the GPU to do proper coherent >>> page table mirroring. Basically when the driver submits the work to >>> the GPU it 'faults' the pages into the CPU and mirror translation >>> table (instead of pinning). >>> >>> Like in ODP, MMU notifiers/HMM are used to monitor for translation >>> changes. If a change comes in the GPU driver checks if an executing >>> command is touching those pages and blocks the MMU notifier until the >>> command flushes, then unfaults the page (blocking future commands) and >>> unblocks the mmu notifier. >> I think blocking mmu notifiers against something that is basically >> controlled by user-space can be problematic. This can block things like >> memory reclaim. If you have user-space access to the device's queues, >> user-space can block the mmu notifier forever. > Really good point. > > I think this means the bare minimum if we don't have recoverable page > faults is to have preemption support like Felix described in his > answer as well. > > Going to keep that in mind, > Christian. > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel