Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752822AbcKYVAF (ORCPT ); Fri, 25 Nov 2016 16:00:05 -0500 Received: from mail-co1nam03on0055.outbound.protection.outlook.com ([104.47.40.55]:11136 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750916AbcKYU7z (ORCPT ); Fri, 25 Nov 2016 15:59:55 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Felix.Kuehling@amd.com; Subject: Re: Enabling peer to peer device transactions for PCIe devices To: Serguei Sagalovitch , Logan Gunthorpe , =?UTF-8?Q?Christian_K=c3=b6nig?= , Jason Gunthorpe , Dan Williams References: <75a1f44f-c495-7d1e-7e1c-17e89555edba@amd.com> <45c6e878-bece-7987-aee7-0e940044158c@deltatee.com> <20161123190515.GA12146@obsidianresearch.com> <7bc38037-b6ab-943f-59db-6280e16901ab@amd.com> <20161123193228.GC12146@obsidianresearch.com> <20161123203332.GA15062@obsidianresearch.com> <20161123215510.GA16311@obsidianresearch.com> <20161123232503.GA13965@obsidianresearch.com> <5e1de9ee-34f5-136d-a07e-f949d492864f@deltatee.com> <209107c7-3098-ca70-7d62-b55021d01faa@deltatee.com> CC: "Deucher, Alexander" , "linux-nvdimm@lists.01.org" , "linux-rdma@vger.kernel.org" , "linux-pci@vger.kernel.org" , "Bridgman, John" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "Sander, Ben" , "Suthikulpanit, Suravee" , "Blinzer, Paul" , "Linux-media@vger.kernel.org" , Haggai Eran From: Felix Kuehling X-Enigmail-Draft-Status: N1110 Organization: AMD Inc. Message-ID: Date: Fri, 25 Nov 2016 15:26:45 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.55.251] X-ClientProxiedBy: MWHPR11CA0014.namprd11.prod.outlook.com (10.172.48.152) To MWHPR12MB1359.namprd12.prod.outlook.com (10.169.205.148) X-MS-Office365-Filtering-Correlation-Id: 212466c2-94d5-4360-092d-08d415715bd8 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:MWHPR12MB1359; X-Microsoft-Exchange-Diagnostics: 1;MWHPR12MB1359;3:Tpd1J2E9ETJbRdiApdktFN8b5g+O4MF4VbJZcqO/9u3o2TD4JICKRqWK2JvBVUi3USaFBhpY40hCcFQ4hqGCSgnPZ8PRUWV+OhJAMalm8O4iZ21ZBEj2r6TXuO7CS0nR1usqUWFagItI0vCyGeH3hnLBiJn4tiMbMtLBJOPlrrXZQsDQq5J11pDmfhb9pbSQvxeZ6vZIk5cQ4+1vx9jv4q8flAGVbE59+6oKZkOzsUgQZYLd3J3/f43+861fouEhI+hs6t9w/615fF9lmGrhOA==;25:+D4q2x48TTFJjjdlt6qLKDNJpX1MgrvjX+NA5peGbWYETslLoNmrycJG6L5RvgZ3koXZ1bT4hke0YCQnNEok9+ccV9Ew8l/BCmiBp9uPtf/14nyPfbeIIRp17pQ3gHQEekoN7OZYSh1fMom5gyX0hpUZ/Qs/OKx5C9JtME0aboM+mBFCxjsqhaXVSFe5yGGS9VZAKF9aTAok2po0oC/2WGOLOXmjOhTmItLy+iRbHiaFmSLxLPq2DbDO/O73Ol/fuTJx8sjG7UIbdHRWHiDnY9d5P3PGo7mEscF/PKYAMrmj5g5Fn2Yio3s6N1vvLP41WOoibG90bKVTXXQ94dFL/q2uLjymzivBWQTUjzjnStNb+ICYO1KN7UmTNQfZNG3SUaZfJNIeDXCgbrSEVciEr1/71fmA7sBJYQoyB49i1PSXAFwit6gKMrqVt83OplKzcJ4+QoQDU27I5d8MW524vA== X-Microsoft-Exchange-Diagnostics: 1;MWHPR12MB1359;31:du+k6Ae1nFX2ZWGTtkFNMijOJaD8bmWmvWSkeVpssngW0tgU68KrmSvnqAIIsL/RgaC95cXd1w9a5WgL8PiMrnxfV493sN4HTI3NodEntTSEaZYSQTTKV+6eRBXAvCldZyQTPl+z0kcCNptLmVDt9PVUo6E5M4CWQEKv/aRILwajyHbgKFlqDTg9sXv4y2Tt4d8Vy0SVprlj/f9Kl9wT8/3ur3VGJUQ873UmrfgnY2iKtS3YkJutlkyk8LzwJPtxl3wyWISjvDqNz/7Qy509KsE0kal68d9lwfNCP7Zsg2U=;20:5fFUswNHSgKu7vvUSwdSbMWDLOf0w2HOSV0b/Ojg2pDbYGQ8CERPtmMS1X8LHBtBsbLvT5Ee4XvZztVBu2CESSq6hchd6ipQyoOa8kWolxwjAGvYMyi9ltK/iZxII3eV+PGU28VgOqEt5He4IHUjcWAh0qTSasVVf2wpp4hu6cykr6UYMITTBgbKkQdpaFpnWw1ecUT4vlak5qzuR7p7SkyFvx0FfLl+xPj2kdUCWUxxy78g6I0R4zSE37hNvX6vFJqiu248Yii77pv7t3XzQz94g+FTlq69NV8pCXzpO8PoAFx8D0tbe3glRp95Dq3zYfzsEp2M3APqQX07pJJKkktyuswSl+BfWqjtW9VdC4s8sWmmGK1H3S+gTNj6ZVjoN3jHyRLgdeBQm3IZWDkUW8CkCf+yjGKy3G8FBWDS83Z9kHOmHG/leso8g4+ojZcGRyqFxDU4f8e4FOs2HOeyap+fpX8RPF16l7E5W35A4X7YX6lrQQiDKUCKMkyV5ufy X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6060326)(6045199)(6040361)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6061324)(6041248)(20161123555025)(20161123560025)(20161123562025)(20161123564025)(6072148);SRVR:MWHPR12MB1359;BCL:0;PCL:0;RULEID:;SRVR:MWHPR12MB1359; X-Microsoft-Exchange-Diagnostics: 1;MWHPR12MB1359;4:PXLWSm8JT8DCOBOpmFCTipGS8uLNLWyeSNZDQi5azeCQa8awPBFrPJmCm466sVsPzStekjnRH4QPaYoaWO3uIqz0oDMgkKl0finFbD1gdCR7ygDtY3kmOquzEYsMY1iuZbMbo5Pwt/L4eVR6mdShaHAjrT+50yqprtVLcKtkn8ykFbb00N3xMBjXaHbquFBbIC535GSxHGvIf30Aga173v17gpfhgMKEjf2vzPNrR/VmJJwQPfn53qISox7JNnWDgE4bn3yCd3dD/Q3DJDJ++l1UnNo8sdlZtudyt5C3jJl410DrNeWxm18ACdndsjkT789IFi7UPe2vr2B4CEFVrexejtwNY9fopoNXLQ+01oC8D3PkXL+IiGCb64lnu8vR6D1goHg2WAhV/k18wxbcr4GZbLeOBkJeHqR2DpQUAnC6wu0JHxsGDQTIrBvPK7rGah6FDve3gAKPNgKelZObFk4PbsdDcxOyripbD2Qz8lLpqghE14yEAeLuuJKDodlz2hgIuxkgIU2BjKmlGU+eJs2otXmg9/KdTYLct46z5rEeLyT15ST5Ee7ukA/mX7Mnu+AnBKSt6bG17VcUR9R2uRdnQ5aUZIZoazM1BRWGQLRApEkX7qFXrnueg37k2LnD2WRX1pjKr9qbiqTaCm9VDA== X-Forefront-PRVS: 01371B902F X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6049001)(7916002)(189002)(377454003)(199003)(377424004)(24454002)(42186005)(39400400001)(47776003)(65956001)(64126003)(36756003)(68736007)(65806001)(66066001)(105586002)(3846002)(106356001)(39380400001)(77096006)(229853002)(39410400001)(189998001)(54356999)(76176999)(50986999)(92566002)(83506001)(230700001)(31686004)(4326007)(2906002)(101416001)(50466002)(8676002)(5001770100001)(86362001)(97736004)(305945005)(39450400002)(6666003)(6116002)(7846002)(7736002)(33646002)(93886004)(5660300001)(81166006)(7416002)(81156014)(38730400001)(23746002)(31696002)(65826007)(4001350100001)(2950100002)(733004);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR12MB1359;H:[172.27.225.16];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;MWHPR12MB1359;23:txl9O3XcIMbDyYAWQRWKE6VY7LyQ0K15ML5Rk?= =?Windows-1252?Q?t0OH+iokU/9sPWA+n7zPdM5ODtF5lnqDG+Ih8kaMnKwQfUyL1Rt+/Lgk?= =?Windows-1252?Q?GPjM0/LdzfzpmQ5mqsRilkFFE2lsBAD5k3mzYtnZDf2gM64OurCSDaMq?= =?Windows-1252?Q?/w7b79SUbjd8dIBKMO7mBTNprQI5snFqnkmD/7FTmP4SBrr7kQ80hiPU?= =?Windows-1252?Q?Q1qQ9SHryvRHhCD/A31uzCuY7AMv9EiNWeHBiuAWlINts1Ff4rTMhLLs?= =?Windows-1252?Q?9nMPEnYrFNwD//+hvmr7LMDrhZgazEOQ8669ZiVQawKj2b3asNcXE9qG?= =?Windows-1252?Q?kim7qzcAPQSFK2NROshq+l2O5YZpOfnIARgplvpu4T3ws6jnQlXzmNTm?= =?Windows-1252?Q?7kxHMQRHirfWRs9qgN62+IRE3TxdyNvY5Q9KAqcSYsK5cifTbfS7IpEW?= =?Windows-1252?Q?jj5Vj3rClNLcj7BKAibGYTUIuaThKNDjZInZ9B5Epi4lnp80H+g0+83C?= =?Windows-1252?Q?PadR1XdJV7YWeQJumIrUFVA02frCGKeKp5FUKFu7ErftuY5ZP/CoIiyD?= =?Windows-1252?Q?rU8mwRmatFXthwrdSXVs16i6CY3C0xiCbn9uhxFi3lkQa3tz0oZMRflY?= =?Windows-1252?Q?Y6LOqN/W6KLsGveHVWajBGeIyp/Fi6CQR2SnHGQvP7iGOB9UM9ZTqC+a?= =?Windows-1252?Q?w/3R4fFIRiUswLp2xk/62emkLZ90ljyHVbcmy6+32ydO6K9Jyel0gFz6?= =?Windows-1252?Q?AGh6VR8x1aYgJrLIlZM1NcVh85h/a2WwFl5Cf1dMCIJ8v63VWn1FYDas?= =?Windows-1252?Q?jQBVQgaVfbia51MpQTPBG2Q3iLuDCBAcRbkyPWxMwlVKFp+xzztazMdZ?= =?Windows-1252?Q?LqIAE7cxF4nXYM3S77M6qb/mBGmHevrzeRTGf4GO/qzHkK5GHQBdozZJ?= =?Windows-1252?Q?ddT9rF52bb2wu1Vip8+CEcQ/dK99y/dIqw8fVgYFGEmqVh/nktTUHw8h?= =?Windows-1252?Q?sA2ZSDf/fvABzd2mG8QlFK13J6NLLw9Vju7Hmr1DvIq5UsWKowqA1xOO?= =?Windows-1252?Q?R8Lwn5QwJxVgy+BLNblsPnNhzwML5zGROKfv8qcmXKkUE+Tpy0K3AhRf?= =?Windows-1252?Q?v+AtOKI0iy9BwhhZhldanNhUQdHfxA6A/2vhxTx8vq2lmLZTTy9K2jYY?= =?Windows-1252?Q?TErEhkNKRstGzNUno+F8Ikvm7yKGxXPrHNFOVea0flzZr2sV6HJOKKoC?= =?Windows-1252?Q?YW8l/+uwKZtVXhWW+IzS+kzi0ARGrw+k1Jnyv3iJbc41A0pLRa+pMoKw?= =?Windows-1252?Q?tMDLGWQ+yoc+hwf1kN+ovypBkFK4JPdo22Iw5Hlajjm+4gLkwqMGRZoJ?= =?Windows-1252?Q?ErnjxdE1HlQDwBaOp00McymcAVLCzhRm7apt7lP9uV6nyeZtUsV1wDh3?= =?Windows-1252?Q?MeaNioSTED+ZvfGOWYiaY74+SsA9L355YHaUVYeZqPq4p3XxrzPr01HN?= =?Windows-1252?Q?pkUYqEaJaWWF75JQdaU8DfMXJKhoBLXYi6RZTmYCY3jWYYMIjFD51EFX?= =?Windows-1252?Q?FNh4zZ8nmJtsUE=3D?= X-Microsoft-Exchange-Diagnostics: 1;MWHPR12MB1359;6:wictTsIMUOCU8jsZGtAQbepfAb6lXQYgDT8knj5/jxTDPqLo6izwSy7vU+34td5euvOQ970P9nlLViZZPPBbhVlTMxX5aNsbo+Bc7Nbde6/UVZlMYElw92TYmIQlZH+PXcGHUHI0SPBRwSzOB7vo04lgc4iXt8+h8L+G+wXvvDaY5wdZsWpPCLWFSmAX5nFjc1/ufF2y3cql9Ekz5O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uhvvGv3+b6SulIRvEyIQB0CeST6PGSEntnLDGbj3Sn73Lxi4TlweBzlsQTJ/lNmNcA==;20:2mZevjzjZJQA+08IOrb3iz91emGW4luA4Cp4Q9IgQOfhumuu/IX2ofQ7UxtPVAHMw1e6s5yWtB+PM5seDZS66eEPSgYSd/NOA/5fO/3wvupHsy5bAJMs+8bjtZx5Pa6TzmOnSC7sECKKGwZ9o2VgShyoQP8JSLjDzb1jF22RZNFvbUxQtHpeXHvrtXEK644+UXCi41xGxOOOfv+qcgC1gG/oAXpcTrtfkGUP0DW6mWvoPjhWn/721LlRjOAvlfqp X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2016 20:26:37.0785 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1359 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1421 Lines: 33 On 16-11-25 12:20 PM, Serguei Sagalovitch wrote: > >> A white list may end up being rather complicated if it has to cover >> different CPU generations and system architectures. I feel this is a >> decision user space could easily make. >> >> Logan > I agreed that it is better to leave up to user space to check what is > working > and what is not. I found that write is practically always working but > read very > often not. Also sometimes system BIOS update could fix the issue. > But is user mode always aware that P2P is going on or even possible? For example you may have a library reading a buffer from a file, but it doesn't necessarily know where that buffer is located (system memory, VRAM, ...) and it may not know what kind of the device the file is on (SATA drive, NVMe SSD, ...). The library will never know if all it gets is a pointer and a file descriptor. The library ends up calling a read system call. Then it would be up to the kernel to figure out the most efficient way to read the buffer from the file. If supported, it could use P2P between a GPU and NVMe where the NVMe device performs a DMA write to VRAM. If you put the burden of figuring out the P2P details on user mode code, I think it will severely limit the use cases that actually take advantage of it. You also risk a bunch of different implementations that get it wrong half the time on half the systems out there. Regards, Felix