Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756424AbdDRUsN (ORCPT ); Tue, 18 Apr 2017 16:48:13 -0400 Received: from ale.deltatee.com ([207.54.116.67]:54644 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755034AbdDRUsL (ORCPT ); Tue, 18 Apr 2017 16:48:11 -0400 To: Dan Williams , Jerome Glisse References: <1492381396.25766.43.camel@kernel.crashing.org> <20170418164557.GA7181@obsidianresearch.com> <20170418190138.GH7181@obsidianresearch.com> <1565047873.28680036.1492547352121.JavaMail.zimbra@redhat.com> Cc: Jason Gunthorpe , Benjamin Herrenschmidt , Bjorn Helgaas , Christoph Hellwig , Sagi Grimberg , "James E.J. Bottomley" , "Martin K. Petersen" , Jens Axboe , Steve Wise , Stephen Bates , Max Gurtovoy , Keith Busch , linux-pci@vger.kernel.org, linux-scsi , linux-nvme@lists.infradead.org, linux-rdma@vger.kernel.org, linux-nvdimm , "linux-kernel@vger.kernel.org" From: Logan Gunthorpe Message-ID: <1cdeee61-2107-a392-4e5e-77a6aa10354f@deltatee.com> Date: Tue, 18 Apr 2017 14:48:03 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.111 X-SA-Exim-Rcpt-To: linux-kernel@vger.kernel.org, linux-nvdimm@ml01.01.org, linux-rdma@vger.kernel.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, linux-pci@vger.kernel.org, keith.busch@intel.com, maxg@mellanox.com, sbates@raithlin.com, swise@opengridcomputing.com, axboe@kernel.dk, martin.petersen@oracle.com, jejb@linux.vnet.ibm.com, sagi@grimberg.me, hch@lst.de, helgaas@kernel.org, benh@kernel.crashing.org, jgunthorpe@obsidianresearch.com, jglisse@redhat.com, dan.j.williams@intel.com X-SA-Exim-Mail-From: logang@deltatee.com Subject: Re: [RFC 0/8] Copy Offload with Peer-to-Peer PCI Memory X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1536 Lines: 36 On 18/04/17 02:31 PM, Dan Williams wrote: > On Tue, Apr 18, 2017 at 1:29 PM, Jerome Glisse wrote: >>> On Tue, Apr 18, 2017 at 12:35 PM, Logan Gunthorpe >>> wrote: >>>> >>>> >>>> On 18/04/17 01:01 PM, Jason Gunthorpe wrote: >>>>> Ultimately every dma_ops will need special code to support P2P with >>>>> the special hardware that ops is controlling, so it makes some sense >>>>> to start by pushing the check down there in the first place. This >>>>> advice is partially motivated by how dma_map_sg is just a small >>>>> wrapper around the function pointer call... >>>> >>>> Yes, I noticed this problem too and that makes sense. It just means >>>> every dma_ops will probably need to be modified to either support p2p >>>> pages or fail on them. Though, the only real difficulty there is that it >>>> will be a lot of work. >>> >>> I don't think you need to go touch all dma_ops, I think you can just >>> arrange for devices that are going to do dma to get redirected to a >>> p2p aware provider of operations that overrides the system default >>> dma_ops. I.e. just touch get_dma_ops(). >> >> This would not work well for everyone, for instance on GPU we usualy >> have buffer object with a mix of device memory and regular system >> memory but call dma sg map once for the list. >> > > ...and that dma_map goes through get_dma_ops(), so I don't see the conflict? The main conflict is in dma_map_sg which only does get_dma_ops once but the sg may contain memory of different types. Logan