Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp249102pxb; Wed, 15 Sep 2021 00:48:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9T0UtIBIaAPiPnYQtXZAMrylhyyeaoTqcjZjBA3Bcy2ITD0kmvq+Sin1IUcZWXevuFUmP X-Received: by 2002:ac2:4822:: with SMTP id 2mr11747350lft.325.1631692115651; Wed, 15 Sep 2021 00:48:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631692115; cv=none; d=google.com; s=arc-20160816; b=Yins3FYnQHZbj77QmY6pSfYIFE9aKQ5YnW2kr9e86iq/tNSw/GtnX41hTrpJGzXRZs 6NhGsWz0gr45RG/febJo259mOHuXTlJhBwxudgTEdYe32ThxKk0cGrI0+DL8g9tEMqYr A//JHlOi4CJ2bP8PkdaEni4BQ4+SNd5FKTuwVLcYk7c+gwz2Ms8PY6CM7MBletCh2TkI 9sdCrcjYMQe6QSYO0W2qHBdK9m4hyUBJQZs2lKaksU4XlyGnTW5SWLDDCVbvOY2oazEC nQ2QpthgEQQJ66UrQrEq3NFbWu4ZCnJQj+c6CMN1dfrivpI0QSOQyhToj5X/qhNb7ZFA 79Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=mXAQue2QtL3BCV6WXPGsnzHQfmMRE3XPQ15CcftlO2I=; b=s7poR61bljqwFn0bcgRBbnKb8rWMuVR7FWVrDOZJb3pcbaT2kp7J8xWfPq9X8kcSnr vxYaMrrtXHIrkEqGnOAGFp1PtLQ1TSo7yN7q59Gi3GdNFfqMBJMdqM4wqg9MQMOU18JU hY9UZVPVjU9Rx7lELLC3ZPTxEMYur7WlRw3x3K1BgknZrsDxSEVouWuICWTN/dl+avCM 5zK/HIHp/Z8ajELtGWh1LIzazlrcuKLGduf3ifk5WHE59YGuK2gPVhtY54HL3Ur5aT/V QFNZVe4589KjxBaiLuUZBhiB3yWjXoOIGUfLveH8d6zcvaEeIfH1sy7NAu2exQ+MbK6j G+LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AIASKWCO; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s19si9593058lfr.107.2021.09.15.00.48.07; Wed, 15 Sep 2021 00:48:35 -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=@kernel.org header.s=k20201202 header.b=AIASKWCO; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236686AbhIOHrX (ORCPT + 99 others); Wed, 15 Sep 2021 03:47:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:43058 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231364AbhIOHrW (ORCPT ); Wed, 15 Sep 2021 03:47:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B7DFB61244; Wed, 15 Sep 2021 07:46:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631691963; bh=4Gj6JwM2F9z6+WV2U6hPIi4DFT6zybwQImEaoQLcouc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=AIASKWCON1uBRCw4lAutBlPVeVE65cDnrLnCYFJ4bYNeSqoXUQggPgg4mg+gC6V/Y TflBPO0hKUGz9p2WxA8dSD1fgu0AIf+InGEhgq8eP3nmJ/fz4JxPSouhcsxb8loBAQ OmPg4ua8EDvhAZsigTuPNJa3td6pXkt2UKphCKj4B3g5FGlTxwszpw5w5WUxrHjztu yeLDXvPTeqE89v+A+Gd7x6/OkVHo0FrUiGsvLqWNSuWQ+aWuOpx5SB4G/ihr8FwUC6 94HI38H82GHVZnLCMLyqxcbtnzOYDZKu8h1ChJhTGa8L9P6LUnl5mMcOCnFyE+CDJj 4TNYDr1HCbL2w== Received: by mail-oi1-f177.google.com with SMTP id y128so3069997oie.4; Wed, 15 Sep 2021 00:46:03 -0700 (PDT) X-Gm-Message-State: AOAM532xNkwkXAt7sVx3JA82pXVogUcJLanpvm7gQNH8JfJz7QEVUHj3 a+iGqgUPLnih/bry3d6sY0AFGjbRegQNEkyyECs= X-Received: by 2002:aca:230f:: with SMTP id e15mr4339173oie.154.1631691962997; Wed, 15 Sep 2021 00:46:02 -0700 (PDT) MIME-Version: 1.0 References: <20210912165309.98695-1-ogabbay@kernel.org> <20210914161218.GF3544071@ziepe.ca> In-Reply-To: <20210914161218.GF3544071@ziepe.ca> From: Oded Gabbay Date: Wed, 15 Sep 2021 10:45:36 +0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 0/2] Add p2p via dmabuf to habanalabs To: Jason Gunthorpe Cc: "Linux-Kernel@Vger. Kernel. Org" , Greg Kroah-Hartman , =?UTF-8?Q?Christian_K=C3=B6nig?= , Gal Pressman , Yossi Leybovich , Maling list - DRI developers , linux-rdma , Linux Media Mailing List , Doug Ledford , Dave Airlie , Alex Deucher , Leon Romanovsky , Christoph Hellwig , amd-gfx list , "moderated list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 14, 2021 at 7:12 PM Jason Gunthorpe wrote: > > On Tue, Sep 14, 2021 at 04:18:31PM +0200, Daniel Vetter wrote: > > On Sun, Sep 12, 2021 at 07:53:07PM +0300, Oded Gabbay wrote: > > > Hi, > > > Re-sending this patch-set following the release of our user-space TPC > > > compiler and runtime library. > > > > > > I would appreciate a review on this. > > > > I think the big open we have is the entire revoke discussions. Having the > > option to let dma-buf hang around which map to random local memory ranges, > > without clear ownership link and a way to kill it sounds bad to me. > > > > I think there's a few options: > > - We require revoke support. But I've heard rdma really doesn't like that, > > I guess because taking out an MR while holding the dma_resv_lock would > > be an inversion, so can't be done. Jason, can you recap what exactly the > > hold-up was again that makes this a no-go? > > RDMA HW can't do revoke. > > So we have to exclude almost all the HW and several interesting use > cases to enable a revoke operation. > > > - For non-revokable things like these dma-buf we'd keep a drm_master > > reference around. This would prevent the next open to acquire > > ownership rights, which at least prevents all the nasty potential > > problems. > > This is what I generally would expect, the DMABUF FD and its DMA > memory just floats about until the unrevokable user releases it, which > happens when the FD that is driving the import eventually gets closed. This is exactly what we are doing in the driver. We make sure everything is valid until the unrevokable user releases it and that happens only when the dmabuf fd gets closed. And the user can't close it's fd of the device until he performs the above, so there is no leakage between users. > > I still don't think any of the complexity is needed, pinnable memory > is a thing in Linux, just account for it in mlocked and that is > enough. > > Jason