Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755548AbcKYR7l (ORCPT ); Fri, 25 Nov 2016 12:59:41 -0500 Received: from mail-cys01nam02on0046.outbound.protection.outlook.com ([104.47.37.46]:38930 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755315AbcKYR7c (ORCPT ); Fri, 25 Nov 2016 12:59:32 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Serguei.Sagalovitch@amd.com; Subject: Re: Enabling peer to peer device transactions for PCIe devices To: Logan Gunthorpe , Jason Gunthorpe 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> <91d28749-bc64-622f-56a1-26c00e6b462a@deltatee.com> <20161124164249.GD20818@obsidianresearch.com> <9cc22068-ede8-c1bc-5d8b-cf6224a7ce05@deltatee.com> CC: Dan Williams , "Deucher, Alexander" , "linux-nvdimm@lists.01.org" , "linux-rdma@vger.kernel.org" , "linux-pci@vger.kernel.org" , "Kuehling, Felix" , "Bridgman, John" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "Koenig, Christian" , "Sander, Ben" , "Suthikulpanit, Suravee" , "Blinzer, Paul" , "Linux-media@vger.kernel.org" , Haggai Eran From: Serguei Sagalovitch Message-ID: <3d92687e-e327-0474-2b3b-4c3301b2c57c@amd.com> Date: Fri, 25 Nov 2016 12:59:07 -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: <9cc22068-ede8-c1bc-5d8b-cf6224a7ce05@deltatee.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.55.251] X-ClientProxiedBy: BL2PR20CA0038.namprd20.prod.outlook.com (10.167.113.176) To BY2PR12MB0696.namprd12.prod.outlook.com (10.163.113.18) X-Microsoft-Exchange-Diagnostics: 1;BY2PR12MB0696;2:PPpnAkpJ2FyNTvk0+WaGUb7AH5H9mv112ZbJecYyqjkV6X1I4L6JGU9gEsquo+wwJ4BPvF3n53PZLtefBw5HlmLTi2GbUxe6CU/L0A5Lqkm7GbGYTYDb655XsKPHJCdKkkjgCmmP4Qr4hial1Sv09fd4AW5crRwvBH8UlMB3y9s=;3:KtWGigKnTUn6xLMoql+R07zUMrBoI/PejEYDO8uWyM/Zb2j21XjIpOn6K0uY70n3u8LRDoUdfgkjAOlpBg0McWo8bLy7VgSS7XN4KZjjLN5zH+DpfC7ZbMsTLxTA6ykkD0nAgCRLwRoUAsTnhz7h1JEGU1Y8NYtE/JfEfQlCKhg=;25:7dSrs1m5GksqJ2Tfu817yaQx+2JO9hp55XrV4BXAk/S/O5rvW9B7vKAotWP6nc5+vRGn2WUDxIN+y26YwU/LcMTaEnx64cqiq41XFwCQY3COpM8IfLdNVwvpYC5FhjX40coiPHxGl1HpFU0JrBuM5lqSnMMtQNdJ6y46sHN0WJBGiyKdU+gDmx+TqLKUW5xzvlYOp0kY7N2Gl6M9vRNhVu0TtgsXyhTJJWvNVjW9AVyhcwJALVvvCacEI0rI8kH103LVkTf9VcUVBVGLNGvbXXnHZm9twA0FsnenExXUmIVx6A2TIhy37McbVtqq7HoU+oEaGb6l7CmJF56B1RVvbfyXJMmHI/4Gf/AjHsS00pGqVPtsoHUT3i6jzkT4AGd2OTkTDhNuYID0lSwedstAkI4TUeCdJoJ+a6TysFqMvsEB1552vnJqjkMmb2atDpDBy6Dhuok8JxXWxW6qea7tDQ== X-MS-Office365-Filtering-Correlation-Id: 9ece9d69-2e98-4814-a5f9-08d4155cc648 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BY2PR12MB0696; X-Microsoft-Exchange-Diagnostics: 1;BY2PR12MB0696;31:wSAqIZzAMX0WGYyg7HmgIh+iBBH8RZ1Q5+KU5nZ63pmznv/FEy8KlWk9+J9fMgDibZXDkHum87tu/etR8bZnmE3ylBJI+fjdx4ob/EyCnm5CAEqFpRJAVLHtRrXZ7BJrsqELYnOMjjiBnQo9STJUt0cJIHtayw5zIJ7sveInfMYGm9FOu2lSbUPRDo1TxOXQciTei3E3LOEFsTOjnOU1JoBeJoScJ1lIj6BU8XqB3A3lCxo+j8ig6/SRWIG1twkMExjhQFrCIsMCHFRwNeWY/g==;20:T94tEHJ9AGa2I5FxREAq+5PNSEIKeOsNzdNqdM2V3fIxta1MFiUCSoWvaov9Q/g8yfDj5E6SGYaZlUNNnhELabvBEVclOv7PMH6j9UI+dCoESaltEJZBFm6nFzd+faWyHVhZCrTfjQ41JH1nnmY84LcXWoFYu+zQwRZn9KiMWQt0cBrV0c2ra3JhAb3YJRBcLbeY8u+RDkqvcZdeppEkWkAg2jdUBnV6ZFl0113K1kIDs13IPx9t3bCPQknia2ETFAFTgQ04rtmAE4xajwMQi/d79qblASfEfSbnj+rw+/8QGa3Nkz/n4RGCnTiYX55rknclMTK5T9V3H50PYRJcATYIHsDGVWhQKcG87Pf6YoUQoF1xV1YNioARB4xfIwcjJKgHLLJTNrF3XyFyqPQB1nyiXwTUkCeqOi1HwhkCqrbT5zv1lkL4qBxugWqrNpk9pcK1pnc1ZiCt0b4gsB4fkxS+HTJCIgqcbRxdV/Db1bstveCHsU82o+rOVcSnCri4 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(100405760836317); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6045199)(6060326)(6040361)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6041248)(6061324)(20161123555025)(20161123564025)(20161123560025)(20161123562025)(6042181);SRVR:BY2PR12MB0696;BCL:0;PCL:0;RULEID:;SRVR:BY2PR12MB0696; X-Microsoft-Exchange-Diagnostics: 1;BY2PR12MB0696;4:v20iShNw2c/e5h4sOprKOmB0bRif+9v1U3NZnzvsqmZu+STN13cuKq2UDdxnXQs7GGFfnljsyNtAAPeJER2e/tDPmd5YUX00ZudgH/jWhiNj0fv81td46RZorvr/hCexV48ZzZsOq0eDkWxftxrK2sQZObb2bLbZvxCSioAcT41Etw38JfazleUYnK08uWurbSnkqGhs7IT3paDBhe7byrj0JWSitYzi6GN2/Wr+FkDX6Mj/SosbswAXuqZE7vpi5zPJHjmHkhHZamzB2/LtRJ8YmGgTIN8b8t7y4lyVDIxfVojvfr+XT2YaOmkjbnntiJDpKRUAM7HaC6sCqOeJvKHnwmwzmNItP2ZhLO55FwbDAVXyVmofgaL1OKj67sPAzCacX9TQM7Ej253i1Eh+h7cE1na61Bs7/asEeNix5HXjuvDAVIElcicNJfE6CkM4XxuJXfrK7A+jSF2dHrWSZSyzceOIvcoF0iYd+CQJyBoJ/+j2WhSJsEVkK2LrrFuJ8EZUGpmapXTa1L/ft9u7hHw4zdIJ+2AffS/CB1QGP21k3VkCGTrxOoxaMnQW1ZM9cKjdG4e4zrP+FikldfbvnWtEHmC2O0nYO714WORI+4h1JlaYPTUAoebynpSSzxGsPMlAoztKg559P82sU3jlzx0nwVylGiwbMMIW1Nd3DcSXggbDQRPL4D2ETtB65KsX X-Forefront-PRVS: 01371B902F X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6049001)(7916002)(76104003)(189002)(199003)(93886004)(31696002)(2906002)(47776003)(230700001)(7846002)(189998001)(5001770100001)(83506001)(229853002)(4001350100001)(64126003)(305945005)(7736002)(97736004)(50466002)(92566002)(4326007)(23746002)(86362001)(101416001)(33646002)(38730400001)(105586002)(2950100002)(6666003)(8676002)(65956001)(36756003)(81166006)(3846002)(31686004)(7416002)(81156014)(65806001)(106356001)(68736007)(65826007)(54356999)(50986999)(42186005)(5660300001)(66066001)(76176999)(77096006)(6116002);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR12MB0696;H:[172.27.224.67];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;BY2PR12MB0696;23:3954bFsHHI4x02yJ5ty3cmpfpPidw473DLQLK?= =?Windows-1252?Q?qQrBwyIOa8u0OCs687AeQGJ3k7BrZgauT6ox+hZyqKwkxaO291y5/Rxk?= =?Windows-1252?Q?zeJ2G/zbMsxSEtrI61AQGqxJQS+1RHTwfsbtZGkitMzXPzWg5i7UBTd6?= =?Windows-1252?Q?oVsov0eQmCYqAVtsNAOeDbLKoLY9VOCzFQoWT7FVGwXeXKwZ5r/oG56l?= =?Windows-1252?Q?crlMu0B+3SHR0etPpZpQzI2rxOyIU0TYTcXjUcBaSI8XtnMJEazARc1u?= =?Windows-1252?Q?VDckG91OdQZr6O83tSSL6vFCvOiXNr5Jes5wGKTDPpRwRZ4xzEqCYMf3?= =?Windows-1252?Q?pwALAB7wWcMpxQ60lk2l3TD3YKa1S5cHhcOZulnYpmWzL2OCkiHSDDV3?= =?Windows-1252?Q?Bz62jaGmedHKPyHKe/Bm/kIhmWbV0hJPel3/aFpLWM3UzkJdT3MdB0rM?= =?Windows-1252?Q?J3P9ari5krEBL+PkW+FzP6ly9BbdqVPqxjUnhJoxRiCUV3QT2YaUpHGW?= =?Windows-1252?Q?gOI1sNQH6rJODSPz2T33IEa0LRVSwUeWxx6sWI7YVE1+SRBMuql8op5W?= =?Windows-1252?Q?V0+o21rZaycvLszzD/rmeg1kDVUhBpSN2MqHIDh44FX7OYG3TzEfKYqk?= =?Windows-1252?Q?B0NH97elXf3GcuzMEbfHxX+TbDMapXfaoIhe0m8pye4hHZ7vpTxglG+m?= =?Windows-1252?Q?xg/WbxKNEgr0tuDdUZtAkpf4GTDkXSd3xq7+4dS4mYFae9yifE3SO1aB?= =?Windows-1252?Q?rjZ8CVfhBKW6nfYEV2JE4J/cp/UoPLzLSLWyg1GOcY77YnH2fzm1f8H5?= =?Windows-1252?Q?TlbU6hTchUI2aZ+lLo1gZY4Ht0tr/zPEGHkSl1Rns02K1NmQEevu42qM?= =?Windows-1252?Q?Jc6IIKjf5eQpUH/oOmy/avBKukD/w5SSBLjTWxo3mvF+I0Yy/Z7ZHFaH?= =?Windows-1252?Q?tb+LveIY9ZwgICLeg/3ztrj7scCAh8k2CfHeZ8C8nFpHU5uL3BB+ZhTB?= =?Windows-1252?Q?poRgMZyr0m6ULg+Y77kQJi0NOiwTqxCVXiLZOif91/Qf3e4pprjXgC9s?= =?Windows-1252?Q?lNKuQ7pPee9eOoPxTjq6vUhQF392Suk/R7zUDVyMgshPy9JNPSj/imwg?= =?Windows-1252?Q?qFSc+s411rEJV1sBes8RyTDAYIZqLQQ9vwJfc4m/hLnO5k7Y2ItnY8TT?= =?Windows-1252?Q?W09YMKSaFb0Cp5mF4rvKYbCSqUwRqO2lyms9Yk+qet7gVxjVecBqcVKf?= =?Windows-1252?Q?PMrgJSd4+lPRrDc8FXAXu9s/1d4eGMnavfQxnetEQga4/yZDZbcw/Y+l?= =?Windows-1252?Q?h7+bgGh8Zuvf/PqPS8b4cGOZ7TQAKBiZIYBhhOKQ6Iw+/SPxyMvF/5/a?= =?Windows-1252?Q?GDWypoHzgpbw6ABTesdkpyXb5xPbxcnPv4tODPfW0FGOTV4cIKh148?= =?Windows-1252?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1;BY2PR12MB0696;6:aMZ1KvBf+KhgzKb43MJ/vbnKqeSsgCne/4/2sKb2565/fGXO5QK9Hhkrm0XsfkEbIlnQrwhsu/VDfBa5jEf1rZN0ZgSLSrUUKhRfTvz4iV0bOCGtIw6tNjD4XBerZolqDAFQDry9buRQ9rg44SEjOO2mXm99cFA60yerrdfWtOHnEkr6m6Gfo+oR1nySj7/3b5RSdZCt3KRelBFtyuM/FyoRp8OSKSWta0G1E6oH4xR1joQC1b33XpTJm1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c/zH51ubv3A5gLz5LEkV8y83Hb/CtFKz5iKWmw94 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2016 17:59:13.6416 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR12MB0696 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1047 Lines: 32 > Well, I guess there's some consensus building to do. The existing > options are: > > * Device DAX: which could work but the problem I see with it is that it > only allows one application to do these transfers. Or there would have > to be some user-space coordination to figure which application gets what > memeroy. About one application restriction: so it is per memory mapping? I assume that it should not be problem for one application to do transfer to the several devices simultaneously? Am I right? May be we should follow RDMA MR design and register memory for p2p transfer from user space? What about the following: a) Device DAX is created b) "Normal" (movable, etc.) allocation will be done for PCIe memory and CPU pointer/access will be requested. c) p2p_mr_register() will be called and CPU pointer (mmap( on DAX Device)) will be returned. Accordingly such memory will be marked as "unmovable" by e.g. graphics driver. d) When p2p is not needed then p2p_mr_unregister() will be called. What do you think? Will it work?