Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754857AbcK1Tfa (ORCPT ); Mon, 28 Nov 2016 14:35:30 -0500 Received: from mail-bn3nam01on0081.outbound.protection.outlook.com ([104.47.33.81]:30624 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754725AbcK1TfS (ORCPT ); Mon, 28 Nov 2016 14:35:18 -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 , Haggai Eran References: <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> <20161128165751.GB28381@obsidianresearch.com> CC: =?UTF-8?Q?Christian_K=c3=b6nig?= , 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" , "Sander, Ben" , "Suthikulpanit, Suravee" , "Blinzer, Paul" , "Linux-media@vger.kernel.org" , Max Gurtovoy From: Serguei Sagalovitch Message-ID: <0d3d56e2-4d2b-85b7-9487-b7ae2aaea610@amd.com> Date: Mon, 28 Nov 2016 14:35:08 -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"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.55.251] X-ClientProxiedBy: SN1PR06CA0024.namprd06.prod.outlook.com (10.163.69.34) To CY1PR12MB0699.namprd12.prod.outlook.com (10.163.238.17) X-MS-Office365-Filtering-Correlation-Id: ef30289c-ad76-46b4-cd95-08d417c5adef X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR12MB0699; X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0699;3:vt6VQgA/aOT8k1Q+UTurbcIUoEw96zgzRb2UDEMM2nfkbVTcfRvQn+Yvtn99C4WNnrukP9RDGYyoE6rqtnPskezBjZ0XYMfJu7MKFkyt9Lbl2spIwu3y/xmYEipdsgQbvr+Un8qehDrhdqpdpjaSCX75xbdR7DaGN8Qd5UNglaCPb2G8uQBJAyoeSQPqYsq3JHWmm4UtFfaMDhInnjap7i+FEpnKDwMBSx9VaGxVqZ4Lfnk8+Zg3LFUPM2pxVsv7H9fJMZFt/VXl0d+0zLM+8Q==;25:WMUMcDEcjsXxqtReFA71Ts4kjUGYgOgXN8kgRP6cuJdeOBlt+JCsnhbfcidy1Sqv7GASJpn7C1I+EFsQ3gbB97xFjUHGO0pN9Po8XFceUcGj1qDFSTHgNzsCtEMUv7B+MKHRqZgruSzkgewLrKRza83QTy6qLRSL6t4aArsPUPh6B4AGSSuiWdOIx8CTbZpn9zGo93Kbf3y7n2iJNQ6QjK4zPRXCaqMgfFMldvWomX/H4MKSks3U2+m040yjyuiokzaiCIgn9Jz+4lIW+kaoJceNbmCg0JiRy7615cxgBQbgaSZD6jt27CRldiCS+g8r+AtR3zWL0vxYsKN9RB6wL5odE7BBMenHMppoGJXnGZKcRQH8tQfcRahQXa/H/IQ9gE4YgEElkh+Cvf5gD/MMAeCDRWK1LhfJdcnpfTe8uxeHP610pZJdPvp5DdXty8HCzL4aBZTFX+9XgRD6MPV2pg== X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0699;31:TvSFKTtk6lzibLZEoko9bKAk1Yyqk7DzpPxPRi0QFzKsODJ1c3ETNbSbxQw0zP3J7Z9TVHmkjN9JXare/29TGv8TJcpJHtuB6SnQbvY6MD8VhO++JUntIYrUtH/rve3MI5Gb7Bt5ILbw30EKQEmqvQAdKBPDBilJRoxgFqX+JFsGpm7cK/gk49vdfy09NJHyPZJMHHqLFb+HrvbYu4T/kBFjhTkM6P1suTvUXgFO/hveexZFCLRSk32GtO6I6XDcLOCHzQ5WrkzRmQOfpo//8Ro3vkGzVqeZTq3WNknaOfM=;20:SO3mLWRbpDnqEZGDo7RaRXezQisH0uheSG/d57l4ixjhOAoFdgF7JnY4F0nJGGi1MBOb6/kOmAKKh3bKRSPnvhTDgAUjDq4LD8rz1CLR8HhHc/sQr+tvsQXpx5rjtkMRrgZCzxLCnKDCRzWJA3OJPpupG+29u5yik0HMOPt0AXBgtdyXHFERdCc5IkB01oR1KSz4iavJeAKRdyxjQymKUkB4SsIP3ILo2nq6HsUJJn5JRklOJ2kFN4XuKzoCbAH4/DFyJ2F1ABgmyk42TH/si9vEx22xnqjBoPSeizjlUUpZau3nLo03BI83rbQxfgqqDpnV78uNw+yHW0nPeEpyjNnUr6D98++Mw6tRNmKlic0H8tiw8yNF2C9DqwcAccoRKGQjHU6wR+qq7pxLicUeTeLEsP5hE7VyBIYWMLU1Pc5DboHKlABfjR3RP7uPSbnWWS5NimD7TuNHjQXprvdrKw9G56LAsp6G63So+zzCRgje88k/y3d3yHPmJ0+lVwlt X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6060326)(6040361)(6045199)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6041248)(6061324)(20161123562025)(20161123564025)(20161123560025)(20161123555025);SRVR:CY1PR12MB0699;BCL:0;PCL:0;RULEID:;SRVR:CY1PR12MB0699; X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0699;4:iL6agq4veKe6xsnKYFHbO1q9ESWH12DFgG/vEhHEjXUDxzLG2l/zJHtCAeOxb7sMThO5VBNNz0ammfPnj5D77Q6MnxVMPvdb0gZARum3hlPsqlWwNqi1BRcsfpsvjyz6HSOenHY+ANOIiKK91QNNuw4Sj4NkMbeBH+eHqv1AGvMHRoZEb8tcb1tx8nfJSDGnNADZvshYTPd+0yRcxnbJC/NNmPVjYPS6lRtxVv/aensRsCumvHHlKrcf6eaJ9FYR911ri7k6dfKg23g2ohUhjbOH5Mw2IU0zG2GE1HXUbq+d47NWJ/QoomL+x/kMvt0u2Tt7RCxpOC+jEC0Az3YdAXcAUe6gQp+S8funv1gQMTNnF4WGUhFX2eYcctBgLZfP379hhb4U98U+IRjTo/TfxtVyp1h1TH96/yWTPVqjmTfOYDQxoVorRzU4pqw2BDtHjtXzld1CEjz5bg/ZIOFOljnmLGEckGPKq0MS4YCrOBAdDK+wwW5HrhC9GdKt5zP7Ia0QN2p7UqIYsMOd4KNDYwiH3Ymc3X8DOk9eBTWckwHjaFeyZ8/aSY/pllWlmJvOZDT7nq4utcFBE5xr7tPqGTxmZYbHURE+5dH7+7Nc9RpPBtj3zTsG2S1XBk8sMeAt X-Forefront-PRVS: 01401330D1 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6049001)(7916002)(377454003)(199003)(377424004)(189002)(24454002)(68736007)(77096006)(36756003)(7736002)(7846002)(65826007)(83506001)(6116002)(3846002)(6486002)(733004)(5660300001)(39450400002)(4326007)(229853002)(47776003)(189998001)(106356001)(305945005)(105586002)(31686004)(5001770100001)(92566002)(64126003)(81166006)(65806001)(65956001)(81156014)(66066001)(8676002)(42186005)(33646002)(86362001)(39380400001)(97736004)(7416002)(38730400001)(4001150100001)(101416001)(50466002)(39410400001)(230700001)(93886004)(31696002)(23746002)(2950100002)(2906002)(6666003)(4001350100001)(76176999)(50986999)(54356999)(39400400001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR12MB0699;H:[172.27.224.67];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;CY1PR12MB0699;23:mpYyXJhebb1+E1PReXiXuBIJ9GkI2/2/5kFAV?= =?Windows-1252?Q?a5CQzZbIaF7b/xKYQdS1Pp4F+6GHtrCALt3OweMxoPWs1Xp7+etVB6tc?= =?Windows-1252?Q?PipcUe7YtP2qEqpuSU26+JrXSfORRKv67x+F1X7f7XWpp8dHYAKPi8oQ?= =?Windows-1252?Q?wZIJAEf5oePNJSXBQeGA8G5Enb0KaFRN1TwxqzbUMShmaX6vgcEqGSt1?= =?Windows-1252?Q?Mot6qOGS/OVODPcxnqPeUHBuZ82YPrCTBuWCcayxHro1cNMBbjdGl5h4?= =?Windows-1252?Q?zn+YzkAHYR4Mmm/iotyqxATG6OViZaknc/0cTG4AqOvsWbMbJ6RL1DYf?= =?Windows-1252?Q?fDQ0buhkuM1+sWKNptBO9iVfMwp839OJbXujjOmaSnQ/DaJG8jLcnXiU?= =?Windows-1252?Q?+wkrSfAhqW2U+UZLnz7AH2x+6fQPYfOd+enVQNyq9nDuXVqPfZiaXolx?= =?Windows-1252?Q?HEV2pLEd/L4bq9iilzxwX7UVfTeoOOSIHayvzg41X7DhXUHFY6LWV+xO?= =?Windows-1252?Q?V121vo8S6YnqYs8wc+kW0OxRKWsV4YCmWTABzKsJb1kTQcpdw9hzLxRF?= =?Windows-1252?Q?KQZ1gSApPjxFkHQsR360eYGQV2TNPEuM8EjzsA++GtDQQPTkEbpv0Kos?= =?Windows-1252?Q?m9F6+SZXEJutKnkUXf5pN+cM3xvn8ooXdxkZlyjzn6WjsI0f8ATp/MRy?= =?Windows-1252?Q?g+qdQutlpPCa8Oa9Op+TmVrXdUjZ8jQ7/ymTB9Q6J2r2sUdIlqMCQw5H?= =?Windows-1252?Q?NP8bnra/WO1cDzrWgZh0i9qdBz3350VLe3o9kyclu8UrlWGwvuGeVXHZ?= =?Windows-1252?Q?1N35HyTYboq3dUaziObp8QmZmKtx2GzYOamhIiSipeJDiYNOslj+oJh1?= =?Windows-1252?Q?1rLqhZ1+bGk0WMTkrveccSgzOmaGdKbkyBgEJYFcCmJlDMaMziGysxM4?= =?Windows-1252?Q?By0EhVxuLqbD9NX+5icbbv2/cbOQi5SBX7ftQFSSjLXaAe+/IZEHujQd?= =?Windows-1252?Q?IIKi+BNPV8sC2SgH1euBZ0oVCod37p4D/RnF3m5XJlqU/+wuZSZ7gMzM?= =?Windows-1252?Q?cn+MoUPY/Nwx82GRWSFN/CD6omHgqZvhOo+nBTTZNtZN6F2YxaH+fYUZ?= =?Windows-1252?Q?7o+mb97xG3BfF0/sX+kzwi0YnVG5SneEyrSs3G0zUhy8+4PA7FwxtDx+?= =?Windows-1252?Q?sD+n73P5fIlzu3ljAruCra2Oh2+WoU4+EYuEwSDA0Sp/Xg/NHyr5W538?= =?Windows-1252?Q?OUMym0I3t2zaRLXSqCP6laAcnGIdvFo+ybtL76uUoNoj19xXXDHk8DI7?= =?Windows-1252?Q?/Hwz6I/6wtLQvHzQTfXeuigOkQWeSR/lBREVSUbP6+c2RiJuraj/UGb6?= =?Windows-1252?Q?Z9OTlw8RTuA8y5RZUiUJ9Nm44iwhLnbo7dDlqEivOG0L4R2VNCS6r3FO?= =?Windows-1252?Q?EYGASjTn5YJckYda9jwy8h0KkZlU8/lbAzouaP7D6YILuIEV3IrXNqwX?= =?Windows-1252?Q?lHkYmWBDKw99+vcZ3LyY7JuK+0XZ6bpmysoV6Hz60o0j7dumwPwBX4aS?= =?Windows-1252?Q?EyOniVjrYiCMbEmDPY2uJL8D4z5h/fRkhQiBJqcUzXPn7iSyrP4s9Ojf?= =?Windows-1252?Q?aR/8Rd7pcKB9BNsbqhKkts=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0699;6:F3UfGcsRCdfM80u9UQzEpKFGBf90jWvNG9T6DWBqKCSMuYszmps149RhkofvW1JP2FqgzTlJVdbLQQaCFa24iVDEJp+I3t9ejTcU/kp8odST0QjTrL2GM9gJyR+yXxcsafNSwocWVHvjzSoAqng2QxpkodjK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b7Lm+eG9e0lwib+FWUw4Bj7sqnIAUhoHkappdkRGqH+nyRxnk6+EOkGEg+eq0OQyT6oxwURgWgakdFi0sear9Vhw==;20:wUbKAk82/ZDO/o4Az4cA7rpp9ecfmwAYbV3rOywi5P76qKZTdaA71d6Rnw3JFlYuzfAyVeVftja8Vcf79d+iZRZAJls4IdDDEcLtEdhKAYil6PZshmWVvE976Q5w/BWak3mNcQ90ZacMiV9wJ4bjlIIOi4LDlL0FMLFDb7kenyt0d4d3Np5iYWd83u5Z6EW/V8q53BxkMKwwti8QFYHGkYMSmS2ZkND1YMlONogYSBBdecOrfMqb1qDaQPTLpkyh X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2016 19:35:13.3368 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0699 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 910 Lines: 17 On 2016-11-28 01:20 PM, Logan Gunthorpe wrote: > > On 28/11/16 09:57 AM, Jason Gunthorpe wrote: >>> On PeerDirect, we have some kind of a middle-ground solution for pinning >>> GPU memory. We create a non-ODP MR pointing to VRAM but rely on >>> user-space and the GPU not to migrate it. If they do, the MR gets >>> destroyed immediately. >> That sounds horrible. How can that possibly work? What if the MR is >> being used when the GPU decides to migrate? I would not support that >> upstream without a lot more explanation.. > Yup, this was our experience when playing around with PeerDirect. There > was nothing we could do if the GPU decided to invalidate the P2P > mapping. As soon as PeerDirect mapping is called then GPU must not "move" the such memory. It is by PeerDirect design. It is similar how it is works with system memory and RDMA MR: when "get_user_pages" is called then the memory is pinned.