Received: by 2002:ab2:715a:0:b0:1fd:c064:50c with SMTP id l26csp68744lqm; Mon, 10 Jun 2024 12:57:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWcjioyP8dqnJd3XcjOWT9oGsfcYFg/61yCwJiOqpGnX4mVJbVDn7mjR/j41t1KkICvfz9bDrjroOFDQ9BBRF1t9suGKxzQcdj4x8SjvA== X-Google-Smtp-Source: AGHT+IGILFtZKXqQtDFiJHK5hzGlxY1XxXwFhOyDFQRrKdXR+ZtmhOClw/ZxrZ1adHbGKsdoCiAe X-Received: by 2002:a17:907:869e:b0:a6f:1275:1616 with SMTP id a640c23a62f3a-a6f127516b1mr393146466b.49.1718049476326; Mon, 10 Jun 2024 12:57:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718049476; cv=pass; d=google.com; s=arc-20160816; b=SoGwRkQ9GemTpwUrlAfdXqWDWoYxHwZVwH/xazhdJ45hDMLtr1JmhLoCIUB/+3w4Il 9p5L/zrdYSU/7AaqmwxXnUtrC+ELjaQpow2coJiHANmVAaq7AYq5ZTNKoWK/Ponk3por udSydoTr1cKXVA5tw6G5qgLoCamB/ysJei7nsSOYeO4MG5s15GaD066UCNZNFaugdThI XEYoS5oMffAD7mgDDDgefI89ArkP6ta944tP9LHe6DO/9SkrUHOR1aSMw/Optqyx5HBK Nv+5BChgqzVXT1EauDpfa9BLGAwxvGmOG3h7ZvNNKXjLXzmhPL0OLNITt7q5O5qCmdGw FzHw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=4FQOUy6eQVbn2rNLxqez3pRfyzUAVY5hKRfgcqQacv4=; fh=f2BhlAVn58+Le21/SU86OeDHNQNtEgF7B4mlSZtPpKM=; b=KVwhME2lTrMhNNUmRllPTSUFmIHA8THeyHEKA8xZ0dW13H6zSQ7GSvDr28/CyoV+MK H/Y75palnQI2CnwdhDgrwsb2PR/2EVREG7MKROOnuCN6sMGPNmYwEQmBMKjfMV+hV4Wp 44WZWBMLMN+P79MliRi9aUhCNQRDySzkPqfdcaAVjixo9wicnpqR5OfbEA/dmsDFOmCL ZLmjbQNSiD4vnhqvRCfmfMKpyxGBTgU41YEhI60lZzVAs9I++7g+dozlPVxs9yFDnqNF pw98uKo3mQh/OZ8/LD8hn+o5QzJusDgi5vAAHF1oeCnoyq/sgD9coIK/ws8AbBGMYTF3 d8qw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=CbMdslNe; arc=pass (i=1 dkim=pass dkdomain=ffwll.ch); spf=pass (google.com: domain of linux-kernel+bounces-208546-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208546-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c80728850si482624866b.813.2024.06.10.12.57.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 12:57:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208546-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=CbMdslNe; arc=pass (i=1 dkim=pass dkdomain=ffwll.ch); spf=pass (google.com: domain of linux-kernel+bounces-208546-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208546-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 29FE21F26901 for ; Mon, 10 Jun 2024 16:22:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BE47743146; Mon, 10 Jun 2024 16:22:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="CbMdslNe" Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7ED9514372B for ; Mon, 10 Jun 2024 16:22:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718036536; cv=none; b=j1YKKkHvu8/kztZ+Ej5P8JUNGpJyt4zGlgXo+e4SK17ye7SvwB7PZnAD2BbE6f1SXoVoKqtATsyHkuHPRk3cPljb0V3KDSmafZm5xcCTAVLoCJmZzyu+e4UJQi2mtQtfXFLBoj8k+yUNOYSeNaAI/64zvkzK4u0wCILcwu1ECD4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718036536; c=relaxed/simple; bh=bxsg4DNdFkYFmIgYwjazkLg1QZ0/79fRk9dWu4LWVVQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UEwQ1OcW8/mboxvUSFsS4aXIoonFXfhBIDDYzBk6WvzZndgsaIzyjAbY+CCKJDWo8/uyhDPC2j9cuEMqeBbQZbsDrRzjfa25VxzyH2MgU4yl4p3NZHClKzi7waHYYtCV2ZVx4yOXPItC/TvxySo5tud4PfOHH8zxV9Kp4VajeSM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch; spf=none smtp.mailfrom=ffwll.ch; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b=CbMdslNe; arc=none smtp.client-ip=209.85.167.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ffwll.ch Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-52c5083aa1bso212653e87.1 for ; Mon, 10 Jun 2024 09:22:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; t=1718036533; x=1718641333; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:from:to:cc:subject:date:message-id:reply-to; bh=4FQOUy6eQVbn2rNLxqez3pRfyzUAVY5hKRfgcqQacv4=; b=CbMdslNexg/lqMGvcz9EOs7GczC7ZsErEpZuX5EE7mc/TvOCgrdEdtuN+shIIBkZfg jE/k9pUF/wE0lzxXJAGbZUFWbgHUZW1CRXIIFvOGWRpYe+4BTrz41dIfimSzQLOkEH6O w42rU8pwt83wT+fwFpjh/p3NbvNiS4JONxgxo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718036533; x=1718641333; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4FQOUy6eQVbn2rNLxqez3pRfyzUAVY5hKRfgcqQacv4=; b=TUl7DoqOCTV7kRQWVuxXn+a2cnkvfk32bDdNUdm9rK7aq02xml2xJom9DDMrvcBRaC I26/7HcVJ30bgLOB3JzcIuquKVws1U2g5c/FDUDhnO6Rt//MpssjDWL480xxpFUkpdsn u+SUjlrKrqTx/cgHa1WkFD6x+xtiCmunj8F1dA6fSbnSb1E8Ds6Egx5/TqVonpOgCsz+ WI8v/uAKdWeedBeAE+s3NZoXaEUjv+r7s5G7afYf1+4iEQOMTnyPqRGWTieGjr+6qPAj YKltOTtzJruiyzNAVsm8av55bkxbDr+nAETB/vqPHD/gWXmJveLEYgWce+bcQTbsZ48C e79A== X-Forwarded-Encrypted: i=1; AJvYcCUSZ7y0ZvSTthcygqozFK9rwV7/vcn0ozqFx58Muw0SyLSeJ4cWRndH0olA6rp40jh11hQ2b3+f7B5w5jk0xdBclz2/Lc7AUKfEjfUA X-Gm-Message-State: AOJu0YxS/Ndx7n3xacydfNZIA1thXM62UX0M8jpbYQbXzDahI2WYRHi1 wLirCGtmGNcVvRgCCIpibkWFh7db6HJWCs57RP/Lb5AsVbcYfMC4lnK3hIw8ZmY= X-Received: by 2002:a05:6512:310c:b0:52c:8e13:a830 with SMTP id 2adb3069b0e04-52c8e13a898mr1364204e87.0.1718036532505; Mon, 10 Jun 2024 09:22:12 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4220ce52c32sm21707585e9.48.2024.06.10.09.22.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 09:22:11 -0700 (PDT) Date: Mon, 10 Jun 2024 18:22:08 +0200 From: Daniel Vetter To: Christian =?iso-8859-1?Q?K=F6nig?= Cc: Jason Gunthorpe , Pavel Begunkov , David Wei , David Ahern , Mina Almasry , Christoph Hellwig , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-alpha@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-arch@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Donald Hunter , Jonathan Corbet , Richard Henderson , Ivan Kokshaysky , Matt Turner , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Andreas Larsson , Jesper Dangaard Brouer , Ilias Apalodimas , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Arnd Bergmann , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Steffen Klassert , Herbert Xu , Willem de Bruijn , Shuah Khan , Sumit Semwal , Yunsheng Lin , Shailend Chand , Harshitha Ramamurthy , Shakeel Butt , Jeroen de Borst , Praveen Kaligineedi Subject: Re: [PATCH net-next v10 02/14] net: page_pool: create hooks for custom page providers Message-ID: Mail-Followup-To: Christian =?iso-8859-1?Q?K=F6nig?= , Jason Gunthorpe , Pavel Begunkov , David Wei , David Ahern , Mina Almasry , Christoph Hellwig , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-alpha@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-arch@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Donald Hunter , Jonathan Corbet , Richard Henderson , Ivan Kokshaysky , Matt Turner , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Andreas Larsson , Jesper Dangaard Brouer , Ilias Apalodimas , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Arnd Bergmann , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Steffen Klassert , Herbert Xu , Willem de Bruijn , Shuah Khan , Sumit Semwal , Yunsheng Lin , Shailend Chand , Harshitha Ramamurthy , Shakeel Butt , Jeroen de Borst , Praveen Kaligineedi References: <5aee4bba-ca65-443c-bd78-e5599b814a13@gmail.com> <20240607145247.GG791043@ziepe.ca> <45803740-442c-4298-b47e-2d87ae5a6012@davidwei.uk> <54975459-7a5a-46ff-a9ae-dc16ceffbab4@gmail.com> <20240610121625.GI791043@ziepe.ca> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Operating-System: Linux phenom 6.8.9-amd64 On Mon, Jun 10, 2024 at 02:38:18PM +0200, Christian K?nig wrote: > Am 10.06.24 um 14:16 schrieb Jason Gunthorpe: > > On Mon, Jun 10, 2024 at 02:07:01AM +0100, Pavel Begunkov wrote: > > > On 6/10/24 01:37, David Wei wrote: > > > > On 2024-06-07 17:52, Jason Gunthorpe wrote: > > > > > IMHO it seems to compose poorly if you can only use the io_uring > > > > > lifecycle model with io_uring registered memory, and not with DMABUF > > > > > memory registered through Mina's mechanism. > > > > By this, do you mean io_uring must be exclusively used to use this > > > > feature? > > > > > > > > And you'd rather see the two decoupled, so userspace can register w/ say > > > > dmabuf then pass it to io_uring? > > > Personally, I have no clue what Jason means. You can just as > > > well say that it's poorly composable that write(2) to a disk > > > cannot post a completion into a XDP ring, or a netlink socket, > > > or io_uring's main completion queue, or name any other API. > > There is no reason you shouldn't be able to use your fast io_uring > > completion and lifecycle flow with DMABUF backed memory. Those are not > > widly different things and there is good reason they should work > > together. > > Well there is the fundamental problem that you can't use io_uring to > implement the semantics necessary for a dma_fence. > > That's why we had to reject the io_uring work on DMA-buf sharing from Google > a few years ago. > > But this only affects the dma_fence synchronization part of DMA-buf, but > *not* the general buffer sharing. More precisely, it only impacts the userspace/data access implicit synchronization part of dma-buf. For tracking buffer movements like on invalidations/refault with a dynamic dma-buf importer/exporter I think the dma-fence rules are acceptable. At least they've been for rdma drivers. But the escape hatch is to (temporarily) pin the dma-buf, which is exactly what direct I/O also does when accessing pages. So aside from the still unsolved question on how we should account/track pinned dma-buf, there shouldn't be an issue. Or at least I'm failing to see one. And for synchronization to data access the dma-fence stuff on dma-buf is anyway rather deprecated on the gpu side too, exactly because of all these limitations. On the gpu side we've been moving to free-standing drm_syncobj instead, but those are fairly gpu specific and any other subsystem should be able to just reuse what they have already to signal transaction completions. Cheers, Sima > > Regards, > Christian. > > > > > Pretending they are totally different just because two different > > people wrote them is a very siloed view. > > > > > The devmem TCP callback can implement it in a way feasible to > > > the project, but it cannot directly post events to an unrelated > > > API like io_uring. And devmem attaches buffers to a socket, > > > for which a ring for returning buffers might even be a nuisance. > > If you can't compose your io_uring completion mechanism with a DMABUF > > provided backing store then I think it needs more work. > > > > Jason > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch