Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp278353pxb; Sat, 21 Aug 2021 02:21:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKLPkGGTZArp/8SqGuZexk6zA/fz1RvqhDX/bPhDUAmMZabZBqnhhrmZ+VCPYkBy+/qRkU X-Received: by 2002:a02:90d0:: with SMTP id c16mr21420089jag.106.1629537709497; Sat, 21 Aug 2021 02:21:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629537709; cv=none; d=google.com; s=arc-20160816; b=pSCYN8UqVZUlYabgGhhLhWzM6t+Mg1tuJTQnsCQJcyz+rhh+twXD28ggR0ppGsDpkJ PJ/EoT487JrCl1aqeGY5aKoZUypI3ap8txpurF4wziqeQ4bF2RsF33VbV/PxiReK5yPG hqxMxzCwlxERE+mwOF+J7jKQY/zEp9fbNN/3dSlCWpMSOo8hyIlzJIV5yCwPkXq8H8fU StPyZMZXMQad5g4XmuB0P+qROPWHi0hv3Y9GlSZy/YVrrXU5dHCgR2LWcIp+4KyrclF1 ZuVpKrSoqbHC9orWq7Dlubvj2XVMSlBlGHJbCc/QLmTerc98ws/1R9c3x8NpLEUdaxPE alFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=6zdtuD4K5LXWMKHYbnVqH1TC+OHwCabeh7riv5NUDRU=; b=p8S79N8W7MsH4En5CDOIJSb/t2+lEzjqYTnWWgAP+n26IaNQQHjunIO3170fEjl2Z5 lns2smr2r7UsztC/746k+bunpOhaXuSZ2+qCUIVfuQxSQCgxC3wXgFZ1o5zuZnjTpyDZ 3aR21y57STFS91LgiGkiGtKYvH7NvnEG0J4KDC6YWy6/iMb460c3hLIHkMEXR6P6WT41 uFwsnYZcPLr+2XcGmn9ZTZJPsaU5G6A2NRo6JYIcbXUBUKq2eH9DIP2nP7fCocAvaeYK r23Mp/vZA4+2z/5JU/YzPE1jUJ6FfG4+SYA4ElzC8jgPb+B6O+aM+NyzBrCiZ1LGSS6Q BjYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=DsRAjwkr; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si10051315ilg.105.2021.08.21.02.21.19; Sat, 21 Aug 2021 02:21:49 -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=@amazon.com header.s=amazon201209 header.b=DsRAjwkr; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233301AbhHUJRL (ORCPT + 99 others); Sat, 21 Aug 2021 05:17:11 -0400 Received: from smtp-fw-9102.amazon.com ([207.171.184.29]:34121 "EHLO smtp-fw-9102.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233240AbhHUJRJ (ORCPT ); Sat, 21 Aug 2021 05:17:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1629537391; x=1661073391; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=6zdtuD4K5LXWMKHYbnVqH1TC+OHwCabeh7riv5NUDRU=; b=DsRAjwkrxN52eO2kC6ZXR+YbiIeFkxBK2OIDxybnREXpac63sPFK4hmD +U12HkvOdSQ7B+HKHrhxV9jrvvB2fnLg2OaEr6unw4r4nm/Mu/ze3g4ZL fe9mpLxPPmjct+CqAGYK+5O751gmTv3fEEm8hyxj94kaIhW+EC4cCFmtX k=; X-IronPort-AV: E=Sophos;i="5.84,340,1620691200"; d="scan'208";a="154103456" Received: from pdx4-co-svc-p1-lb2-vlan3.amazon.com (HELO email-inbound-relay-2a-1c1b5cdd.us-west-2.amazon.com) ([10.25.36.214]) by smtp-border-fw-9102.sea19.amazon.com with ESMTP; 21 Aug 2021 09:16:24 +0000 Received: from EX13D19EUB003.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-2a-1c1b5cdd.us-west-2.amazon.com (Postfix) with ESMTPS id 493B4A26F2; Sat, 21 Aug 2021 09:16:21 +0000 (UTC) Received: from 8c85908914bf.ant.amazon.com (10.43.160.41) by EX13D19EUB003.ant.amazon.com (10.43.166.69) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Sat, 21 Aug 2021 09:16:13 +0000 Subject: Re: [RFC] Make use of non-dynamic dmabuf in RDMA To: Jason Gunthorpe CC: Daniel Vetter , Sumit Semwal , =?UTF-8?Q?Christian_K=c3=b6nig?= , Doug Ledford , "open list:DMA BUFFER SHARING FRAMEWORK" , dri-devel , Linux Kernel Mailing List , linux-rdma , Oded Gabbay , Tomer Tayar , Yossi Leybovich , Alexander Matushevsky , Leon Romanovsky , Jianxin Xiong , John Hubbard References: <20210818074352.29950-1-galpress@amazon.com> <20210819230602.GU543798@ziepe.ca> <20210820123316.GV543798@ziepe.ca> <0fc94ac0-2bb9-4835-62b8-ea14f85fe512@amazon.com> <20210820143248.GX543798@ziepe.ca> From: Gal Pressman Message-ID: Date: Sat, 21 Aug 2021 12:16:08 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210820143248.GX543798@ziepe.ca> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.43.160.41] X-ClientProxiedBy: EX13P01UWA001.ant.amazon.com (10.43.160.213) To EX13D19EUB003.ant.amazon.com (10.43.166.69) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/08/2021 17:32, Jason Gunthorpe wrote: > On Fri, Aug 20, 2021 at 03:58:33PM +0300, Gal Pressman wrote: > >> Though it would've been nicer if we could agree on a solution that could work >> for more than 1-2 RDMA devices, using the existing tools the RDMA subsystem has. > > I don't think it can really be done, revoke is necessary, and isn't a > primitive we have today. > > Revoke is sort of like rereg MR, but with a guaranteed no-change to > the lkey/rkey > > Then there is the locking complexity of linking the mr creation and > destruction to the lifecycle of the pages, which is messy and maybe > not general. For instance mlx5 would call its revoke_mr, disconnect > the dmabuf then destroy the mkey - but this is only safe because mlx5 > HW can handle concurrent revokes. Thanks, that makes sense. >> That's why I tried to approach this by denying such attachments for non-ODP >> importers instead of exposing a "limited" dynamic importer. > > That is fine if there is no revoke - once revoke exists we must have > driver and HW support. Agree. IIUC, we're talking about three different exporter "types": - Dynamic with move_notify (requires ODP) - Dynamic with revoke_notify - Static Which changes do we need to make the third one work?