Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4648322pxj; Tue, 22 Jun 2021 05:09:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2GtcKfFsZ6kVp8oTDmpOrN137vEKAP1PflXHI86WwC78c5uuG/fRC/m1AfsVBF6F/IL5j X-Received: by 2002:a05:6402:2789:: with SMTP id b9mr4475359ede.142.1624363752073; Tue, 22 Jun 2021 05:09:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624363752; cv=none; d=google.com; s=arc-20160816; b=L5ZAr0t6OQ7UnAjsWF7OOlShwDERzDAI1PDvZbJWS8E6mTioYWYnQ7xLuyzFKSGspX syXp3AdHDq6e5ApnUVoW3niwBnuC+MYBKAbCjM5pebzUp/J7POFkhTEjMuWG3FoB8ruI KUpk3uZQMOl37PTwfPYmOm6L0COktuKIeND9Q9IqCACvQplbhGsbr/T2e0drhuCg5S2o aZziA+t3rNmWLsPvGlExiD+Kq3+MKeq4HH1JHesRCAsZ4PNb+othRx086aeiUhkAKhmZ Q+U3ilY3knmY+JFnwpR3kpOdHxWMIQaBkwjnxakSjZtKss08yuGORszedRSe/P7xWtWG 8roA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=UXu33zooM1Crc13Vebp8C5tdePhjb755cOhdTYx1RhI=; b=v/1GdhYODWCuwEVXgAQm2CLU29vkIjHpYPiO77PZtHFqfBMx5/VyycpawhmwU4zIQf M+ErUnoCTmmBAYOnO7hKRoi5NCGGjtnLbr+Jd1sFo3Ny75b0f99e/IgIZfLp+kU3MTQr ZP/2wf210d9/o6S928ASJtNEMkQbENVciS26U8EToChimkkRp2a81TAKbjnjTFaDoQ4m Frp+nfWCFWj11AYBUXL++3Ha1Dy4FMm/xAktZJrmvxOcBhzJT4uiRJIEsRLSYax9sx0Z mNYTaYD9R02hXxFAJL9fOors99V8LoYYryssvtTy1v6+yp1QaOzBrAqAOEzwdpe5xQOd hqAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IBxYEyz8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b16si20106206ede.389.2021.06.22.05.08.49; Tue, 22 Jun 2021 05:09:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IBxYEyz8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231318AbhFVMHQ (ORCPT + 99 others); Tue, 22 Jun 2021 08:07:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231276AbhFVMHO (ORCPT ); Tue, 22 Jun 2021 08:07:14 -0400 Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FFB4C061574; Tue, 22 Jun 2021 05:04:58 -0700 (PDT) Received: by mail-oi1-x22b.google.com with SMTP id t40so23475185oiw.8; Tue, 22 Jun 2021 05:04:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=UXu33zooM1Crc13Vebp8C5tdePhjb755cOhdTYx1RhI=; b=IBxYEyz8qFrpyXjdmOhua9qpGyNdwX02NaojZVpftJeAz4cyuDCEAd0+qADxitTYR9 7LRSirAlbT/vLaBcd+EYJxNpTrceIy3pY9v4vL2s6kVGve2mWavF/S9gdoUEARKwK86J MRxtY7QJRKDwFpOVd1o8eFa7zoGV0XWD+kEyUY9F4Fya8NeamnK6jjoUDTk28fAgr6hp xtzu8p/laLWYbN9YzUjaZnlg2BzkAEBUrlpuilkihQrotRNoB1aKYIzadRsiBb/qRf5P 5eigpS//hdZK/xPV9k2CHEAQdna490dEykBfiNm2Sx4X4XKQnb3AfoUMJXKOf+KtYuYs /9Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=UXu33zooM1Crc13Vebp8C5tdePhjb755cOhdTYx1RhI=; b=k1ECK+fAcnROWxBvZQDQP/K9jTBoZmDvzERi+biK6ZlPeqvCd1b+jXbMbIM67oGxIw MODB2zi4V4IYd+8krZCYRho86jdoynSkr/5mYLS3pxjeG3BQZEl9fUh62LS6+s8x55sO iJnz7Uqq6MHOjdtKM/jTQXV+SQvbrnqmtha9YS47WayhTY+xfXrRbEagtw7UuPmXjJuw 0D0OSEAxBHpEV07Bpr9pcdivOG5ZvI+pFxPHbRLqd+BPxRkm4mmpPPNyVTV1jMsj0sDm bkGAUcOLJ3sEeGmXQ7IaF0y3EEB7A3hscArzl3/Z9ZzQxK2xLlOJ50Vcv0O+3leCN6Yx 6tqw== X-Gm-Message-State: AOAM533dFAztzj6MnI0PpH0SeaLyRSoHa0Cqx1QppMw6vZhwC8bFSwhz DPuxgM7TXchH+DhHRZFCGkgEuuek9gq2EVGQ39g= X-Received: by 2002:aca:ac02:: with SMTP id v2mr2855756oie.154.1624363497566; Tue, 22 Jun 2021 05:04:57 -0700 (PDT) MIME-Version: 1.0 References: <20210621141217.GE1096940@ziepe.ca> <20210621175511.GI1096940@ziepe.ca> <20210621232912.GK1096940@ziepe.ca> <20210622120142.GL1096940@ziepe.ca> In-Reply-To: <20210622120142.GL1096940@ziepe.ca> From: Oded Gabbay Date: Tue, 22 Jun 2021 15:04:30 +0300 Message-ID: Subject: Re: [Linaro-mm-sig] [PATCH v3 1/2] habanalabs: define uAPI to export FD for DMA-BUF To: Jason Gunthorpe Cc: =?UTF-8?Q?Christian_K=C3=B6nig?= , Gal Pressman , sleybo@amazon.com, linux-rdma , Oded Gabbay , Christoph Hellwig , Linux Kernel Mailing List , dri-devel , =?UTF-8?Q?Christian_K=C3=B6nig?= , "moderated list:DMA BUFFER SHARING FRAMEWORK" , Doug Ledford , Tomer Tayar , amd-gfx list , Greg KH , Alex Deucher , Leon Romanovsky , "open list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 22, 2021 at 3:01 PM Jason Gunthorpe wrote: > > On Tue, Jun 22, 2021 at 11:42:27AM +0300, Oded Gabbay wrote: > > On Tue, Jun 22, 2021 at 9:37 AM Christian K=C3=B6nig > > 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 ac= cess > > > >> to these pages through the userspace. > > > > Arguably mmaping the memory is a better choice, and is the directio= n > > > > that Logan's series goes in. Here the use of DMABUF was specificall= y > > > > 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. > > > > That was one of the reasons we didn't even considered using the mappi= ng > > > 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 redu= ced > > > > performance just to squeeze into DMABUF.. > > > > 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. > > You still have the issue that this patch is doing all of this P2P > stuff wrong - following the already NAK'd AMD approach. Could you please point me exactly to the lines of code that are wrong in your opinion ? I find it hard to understand from your statement what exactly you think that we are doing wrong. The implementation is found in the second patch in this patch-set. Thanks, Oded > > > 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. > > Jason