public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Jason Gunthorpe <jgg@ziepe.ca>, Oded Gabbay <oded.gabbay@gmail.com>
Cc: "Christian König" <ckoenig.leichtzumerken@gmail.com>,
	"Gal Pressman" <galpress@amazon.com>,
	sleybo@amazon.com, linux-rdma <linux-rdma@vger.kernel.org>,
	"Oded Gabbay" <ogabbay@kernel.org>,
	"Christoph Hellwig" <hch@lst.de>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"moderated list:DMA BUFFER SHARING FRAMEWORK"
	<linaro-mm-sig@lists.linaro.org>,
	"Doug Ledford" <dledford@redhat.com>,
	"Tomer Tayar" <ttayar@habana.ai>,
	"amd-gfx list" <amd-gfx@lists.freedesktop.org>,
	"Greg KH" <gregkh@linuxfoundation.org>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Leon Romanovsky" <leonro@nvidia.com>,
	"open list:DMA BUFFER SHARING FRAMEWORK"
	<linux-media@vger.kernel.org>
Subject: Re: [Linaro-mm-sig] [PATCH v3 1/2] habanalabs: define uAPI to export FD for DMA-BUF
Date: Tue, 22 Jun 2021 14:23:03 +0200	[thread overview]
Message-ID: <d497b0a2-897e-adff-295c-cf0f4ff93cb4@amd.com> (raw)
In-Reply-To: <20210622120142.GL1096940@ziepe.ca>

Am 22.06.21 um 14:01 schrieb Jason Gunthorpe:
> On Tue, Jun 22, 2021 at 11:42:27AM +0300, Oded Gabbay wrote:
>> On Tue, Jun 22, 2021 at 9:37 AM Christian König
>> <ckoenig.leichtzumerken@gmail.com> wrote:
>>> Am 22.06.21 um 01:29 schrieb Jason Gunthorpe:
>>>> On Mon, Jun 21, 2021 at 10:24:16PM +0300, Oded Gabbay wrote:
>>>>
>>>>> Another thing I want to emphasize is that we are doing p2p only
>>>>> through the export/import of the FD. We do *not* allow the user to
>>>>> mmap the dma-buf as we do not support direct IO. So there is no access
>>>>> to these pages through the userspace.
>>>> Arguably mmaping the memory is a better choice, and is the direction
>>>> that Logan's series goes in. Here the use of DMABUF was specifically
>>>> designed to allow hitless revokation of the memory, which this isn't
>>>> even using.
>>> The major problem with this approach is that DMA-buf is also used for
>>> memory which isn't CPU accessible.
> That isn't an issue here because the memory is only intended to be
> used with P2P transfers so it must be CPU accessible.

No, especially P2P is often done on memory resources which are not even 
remotely CPU accessible.

That's one of the major reasons why we use P2P in the first place. See 
the whole XGMI implementation for example.

> Thanks Jason for the clarification, but I honestly prefer to use
> DMA-BUF at the moment.
> It gives us just what we need (even more than what we need as you
> pointed out), it is *already* integrated and tested in the RDMA
> subsystem, and I'm feeling comfortable using it as I'm somewhat
> familiar with it from my AMD days.
>>> That was one of the reasons we didn't even considered using the mapping
>>> memory approach for GPUs.
> Well, now we have DEVICE_PRIVATE memory that can meet this need
> too.. Just nobody has wired it up to hmm_range_fault()
>
>>>> So you are taking the hit of very limited hardware support and reduced
>>>> performance just to squeeze into DMABUF..
> You still have the issue that this patch is doing all of this P2P
> stuff wrong - following the already NAK'd AMD approach.

Well that stuff was NAKed because we still use sg_tables, not because we 
don't want to allocate struct pages.

The plan is to push this forward since DEVICE_PRIVATE clearly can't 
handle all of our use cases and is not really a good fit to be honest.

IOMMU is now working as well, so as far as I can see we are all good here.

>> I'll go and read Logan's patch-set to see if that will work for us in
>> the future. Please remember, as Daniel said, we don't have struct page
>> backing our device memory, so if that is a requirement to connect to
>> Logan's work, then I don't think we will want to do it at this point.
> It is trivial to get the struct page for a PCI BAR.

Yeah, but it doesn't make much sense. Why should we create a struct page 
for something that isn't even memory in a lot of cases?

Regards,
Christian.



  parent reply	other threads:[~2021-06-22 12:23 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210618123615.11456-1-ogabbay@kernel.org>
2021-06-21 12:28 ` [PATCH v3 1/2] habanalabs: define uAPI to export FD for DMA-BUF Daniel Vetter
2021-06-21 13:02   ` Greg KH
2021-06-21 14:12     ` Jason Gunthorpe
2021-06-21 16:26       ` Oded Gabbay
2021-06-21 17:55         ` Jason Gunthorpe
2021-06-21 18:27           ` Daniel Vetter
2021-06-21 19:24             ` Oded Gabbay
2021-06-21 23:29               ` Jason Gunthorpe
2021-06-22  6:37                 ` [Linaro-mm-sig] " Christian König
2021-06-22  8:42                   ` Oded Gabbay
2021-06-22 12:01                     ` Jason Gunthorpe
2021-06-22 12:04                       ` Oded Gabbay
2021-06-22 12:15                         ` Jason Gunthorpe
2021-06-22 13:12                           ` Oded Gabbay
2021-06-22 15:11                             ` Jason Gunthorpe
2021-06-22 15:24                               ` Christian König
2021-06-22 15:28                                 ` Jason Gunthorpe
2021-06-22 15:31                                   ` Oded Gabbay
2021-06-22 15:31                                   ` Christian König
2021-06-22 15:40                                     ` Oded Gabbay
2021-06-22 15:49                                       ` Christian König
2021-06-22 15:24                               ` Oded Gabbay
2021-06-22 15:34                                 ` Jason Gunthorpe
2021-06-22 12:23                       ` Christian König [this message]
2021-06-22 15:23                         ` Jason Gunthorpe
2021-06-22 15:29                           ` Christian König
2021-06-22 15:40                             ` Jason Gunthorpe
2021-06-22 15:48                               ` Christian König
2021-06-22 16:05                                 ` Jason Gunthorpe
2021-06-23  8:57                                   ` Christian König
2021-06-23  9:14                                     ` Oded Gabbay
2021-06-23 18:24                                     ` Jason Gunthorpe
2021-06-23 18:43                                       ` Oded Gabbay
2021-06-23 18:50                                         ` Jason Gunthorpe
2021-06-23 19:00                                           ` Oded Gabbay
2021-06-23 19:34                                             ` Jason Gunthorpe
2021-06-23 19:39                                               ` Oded Gabbay
2021-06-24  0:45                                                 ` Jason Gunthorpe
2021-06-24  5:40                                                 ` Christoph Hellwig
2021-06-24  5:34                                             ` Christoph Hellwig
2021-06-24  8:07                                               ` Christian König
2021-06-24  8:12                                                 ` Christoph Hellwig
2021-06-24  9:52                                                   ` Christian König
2021-06-24 13:22                                                     ` Christoph Hellwig
2021-06-22 16:50                             ` Felix Kuehling
2021-06-21 14:20     ` Daniel Vetter
2021-06-21 14:49       ` Jason Gunthorpe
2021-06-21 14:17   ` Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d497b0a2-897e-adff-295c-cf0f4ff93cb4@amd.com \
    --to=christian.koenig@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=ckoenig.leichtzumerken@gmail.com \
    --cc=dledford@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=galpress@amazon.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@lst.de \
    --cc=jgg@ziepe.ca \
    --cc=leonro@nvidia.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=oded.gabbay@gmail.com \
    --cc=ogabbay@kernel.org \
    --cc=sleybo@amazon.com \
    --cc=ttayar@habana.ai \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox