Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp191302lqo; Tue, 7 May 2024 17:24:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVHAX5tB/EQU72DRg2f8p2bs80lwev5aMxq6ByVrX35yMUKFuIWxe8CmX3QC5zp+NojZ7Hquc4ytePj1ZHr8AydqG5whZzicVVGCdlqYw== X-Google-Smtp-Source: AGHT+IEEUjQQWqldi4eJBZY8UHj44qBGl15AB6QAF8kRfoc1fjCUCdGHgFxbZ1lagvKFgs0Swtfb X-Received: by 2002:aa7:8d0d:0:b0:6f0:c88e:a0dd with SMTP id d2e1a72fcca58-6f49c2ad151mr1254819b3a.28.1715127886116; Tue, 07 May 2024 17:24:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715127886; cv=pass; d=google.com; s=arc-20160816; b=KPhp1OXkO4/ngqpg3/RluAfjmVhaClvPUGSHU1u3NHSkU0ckPWWN5cu+4A6YtyyoR+ 8BvAa+uKVbP8+kPL73xWgCky3IgArqwYMm5qsiVHWwRxoIr9Nw4uW4te4WR4jKi34aMF j9XR5KBO9tRQidLJd0vVg/E+dp6Tq7soYL+D2ODgtjRIraq5aK+gg66N43aKTkFBIA3a pqIE6Bir/3pqyA+o4I/oQLqUjqLC1y4bs0NYbFIFM0gMj2V3cAw942FsUTIFY6nNn5nm bceMmKmynoYnsWzCDpNn6z4Ss904Z3eiDEExYU16YjkNoWJNDoZA423M870jRqKvMvbi 3aFA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=cP7hm5cgGIFObZwmlEXmT4H6ZLJ5hLejs2qh73QUpsY=; fh=Adawy1pTpCCMWE4j3RLsjBkBLSkZ6F+Cw3hmjUF7524=; b=fnRRd7wvDl/4aToABdDFwQ8o0Xa6yhhSelWbYkLZjvtbJAXqBOfRj8I3D6GRwqRGpc uiL00GOyXiVfRcn8YTY9WEbOomvDKkkz7e6rd1DHz2N+sP55LEo0t3MOPVLgINzoYBPI et/vs6z9Hbdb1MQF+TRtcTFQ+uiUS4OMNaZqKSRcNePKqPXdOPKafyYsMz9eyZADMgAu y9HZPPJCN65J293FUHMGWEZYhmAVXBmefxgxEj2uD7Kradpcz76M1PGtcwAWsu9kUSgm ezgoH7xQFzVk4WgfkPtXKrXwdHgnjEwdgdnv9ZyKhO7XLtEWao15/b7XhgbziX8EHmmc yIwQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=kLgbb4QD; arc=pass (i=1 spf=pass spfdomain=ziepe.ca dkim=pass dkdomain=ziepe.ca); spf=pass (google.com: domain of linux-kernel+bounces-172520-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172520-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id g16-20020a056a000b9000b006f4816b00besi4406610pfj.373.2024.05.07.17.24.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 17:24:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172520-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=kLgbb4QD; arc=pass (i=1 spf=pass spfdomain=ziepe.ca dkim=pass dkdomain=ziepe.ca); spf=pass (google.com: domain of linux-kernel+bounces-172520-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172520-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E7BCEB23807 for ; Wed, 8 May 2024 00:03:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C7177FBA3; Tue, 7 May 2024 23:32:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="kLgbb4QD" Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) (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 9764785935 for ; Tue, 7 May 2024 23:32:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715124772; cv=none; b=deoDP0xYqu6UfioHb+kkdmxV6ynFTvmzj4opox3aTTZ3394Il4edY3ypnmCkbECht7UbYCcFaBQYN2xIdGzqElNjv1FIu/FUBbZzWdpfBHv/tS+6aeyTqL2goeNkGXXBm6BvqettRFLxvqAHhiTTs9KHn0Z+WbH0cyE3Nk711DE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715124772; c=relaxed/simple; bh=S2uBTZg89QC23t/2WuaFpXUGHgJQVwlXA9YYtSljwBo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dtRxho3X/N3f4kFgQNqb4KrUJ72Vu1CadG7LN0M670c5p++5JnP/otpvOkzm/5TkpC3D79N5tdiIQ3xvMYxVgy1sZnk0VxgnaieHVEWHk4GWzdEPac450hQjKjNqrnOaAW+aRlUD70fUZLib6cGmcE6jBeHyg6xv+3/0vQ7O0oA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=kLgbb4QD; arc=none smtp.client-ip=209.85.160.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Received: by mail-qt1-f181.google.com with SMTP id d75a77b69052e-437610adf96so21484121cf.3 for ; Tue, 07 May 2024 16:32:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1715124768; x=1715729568; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=cP7hm5cgGIFObZwmlEXmT4H6ZLJ5hLejs2qh73QUpsY=; b=kLgbb4QDiYjjhbVyqnASJTqYVBMpFZOu0trzJrO++O0tgH216w9YbqRM7XZIqXipzP DU7LaKiHJo+E9DfRMOf3yG/lgGvIKPfZegBXl5VnL64GTcnVXxbA2wVHsGQ+Grsyo0fc eSCOy1wI0RHUjdPVCTMH8wp2yDyyMFvV/XUHhkbTPNutQ72aqilYR3nVWDQQVwt5D1z2 CKQtLDYFc1SFzbSLM1F6oA/FT669ybhGR9UhqpSu7S/9p/Y0yeuCrv1BtOQGkQuoiPKM IRDQC38DkPdYqATOLE4nt7CYXbckLb/80m/t3XhzxmOZ+VOgARatj3XQtpjCKsgKUATY kZXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715124768; x=1715729568; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=cP7hm5cgGIFObZwmlEXmT4H6ZLJ5hLejs2qh73QUpsY=; b=TZX/+4WSv3q4zeazg6WmydzSxKairMx3+Tj+NH6PZ8sgSAqOwbrDWESeRh9cQjFD4e XYDv4qIvDm1YfQDgv7FJ2blR8u81kNOJHn6Jd4tdnWN1+892+74JcYOoV0zzsxyp+YnZ DJqQLTCLpZ4ubC4c51uazkxc9/9MLrGxkMkbJpx7oYqBxd/2JLVxGcZ93fWiyolshP9q jpCG/zAxL57m9sROsj6abHp4dWiUVRRmG07PqASP519uoiyMQ4upqDzcUTQVhw8pd1qH fK7FP6kmtpBnN+Gwr1Ha9Cdq43FYdMcgEE5DBUnHN1RB3W+0Gl/TV1yALemY8K/KcqD0 EQ/A== X-Forwarded-Encrypted: i=1; AJvYcCU9PahPzed3UDZrVswNJ5dbyUVdQm+ycEM4tdHYF13auhopV2Tf1XshMGcAF0Btpi9SpJIU6BYQVK4TlzIFevAkXEFrIKVhYGX6bZIA X-Gm-Message-State: AOJu0YzFdFVcSino3puHeT8rBYdLAgxvW5TmFJwRHSs3qAso3CfcEFt8 oTsuf47wYVTtAJ7eA+tIXvZo6QyLVOIT4AwLHocguohTS6dg3cZhuZ7CoP1eDAA= X-Received: by 2002:a05:622a:60c:b0:434:b593:2d25 with SMTP id d75a77b69052e-43dbf0b35e3mr10728951cf.66.1715124768502; Tue, 07 May 2024 16:32:48 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-68-80-239.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.80.239]) by smtp.gmail.com with ESMTPSA id fb20-20020a05622a481400b00434efa0feaasm6953842qtb.1.2024.05.07.16.32.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 16:32:48 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1s4UIh-0003NT-Cq; Tue, 07 May 2024 20:32:47 -0300 Date: Tue, 7 May 2024 20:32:47 -0300 From: Jason Gunthorpe To: Pavel Begunkov Cc: 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 , 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 , David Ahern , Willem de Bruijn , Shuah Khan , Sumit Semwal , Christian =?utf-8?B?S8O2bmln?= , Amritha Nambiar , Maciej Fijalkowski , Alexander Mikhalitsyn , Kaiyuan Zhang , Christian Brauner , Simon Horman , David Howells , Florian Westphal , Yunsheng Lin , Kuniyuki Iwashima , Jens Axboe , Arseniy Krasnov , Aleksander Lobakin , Michael Lass , Jiri Pirko , Sebastian Andrzej Siewior , Lorenzo Bianconi , Richard Gobert , Sridhar Samudrala , Xuan Zhuo , Johannes Berg , Abel Wu , Breno Leitao , David Wei , Shailend Chand , Harshitha Ramamurthy , Shakeel Butt , Jeroen de Borst , Praveen Kaligineedi Subject: Re: [RFC PATCH net-next v8 02/14] net: page_pool: create hooks for custom page providers Message-ID: <20240507233247.GK4718@ziepe.ca> References: <20b1c2d9-0b37-414c-b348-89684c0c0998@gmail.com> <20240507161857.GA4718@ziepe.ca> <20240507164838.GG4718@ziepe.ca> <0d5da361-cc7b-46e9-a635-9a7a4c208444@gmail.com> <20240507175644.GJ4718@ziepe.ca> <6a50d01a-b5b9-4699-9d58-94e5f8f81c13@gmail.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <6a50d01a-b5b9-4699-9d58-94e5f8f81c13@gmail.com> On Tue, May 07, 2024 at 08:35:37PM +0100, Pavel Begunkov wrote: > On 5/7/24 18:56, Jason Gunthorpe wrote: > > On Tue, May 07, 2024 at 06:25:52PM +0100, Pavel Begunkov wrote: > > > On 5/7/24 17:48, Jason Gunthorpe wrote: > > > > On Tue, May 07, 2024 at 09:42:05AM -0700, Mina Almasry wrote: > > > > > > > > > 1. Align with devmem TCP to use udmabuf for your io_uring memory. I > > > > > think in the past you said it's a uapi you don't link but in the face > > > > > of this pushback you may want to reconsider. > > > > > > > > dmabuf does not force a uapi, you can acquire your pages however you > > > > want and wrap them up in a dmabuf. No uapi at all. > > > > > > > > The point is that dmabuf already provides ops that do basically what > > > > is needed here. We don't need ops calling ops just because dmabuf's > > > > ops are not understsood or not perfect. Fixup dmabuf. > > > > > > Those ops, for example, are used to efficiently return used buffers > > > back to the kernel, which is uapi, I don't see how dmabuf can be > > > fixed up to cover it. > > > > Sure, but that doesn't mean you can't use dma buf for the other parts > > of the flow. The per-page lifetime is a different topic than the > > refcounting and access of the entire bulk of memory. > > Ok, so if we're leaving uapi (and ops) and keep per page/sub-buffer as > is, the rest is resolving uptr -> pages, and passing it to page pool in > a convenient to page pool format (net_iov). I'm not going to pretend to know about page pool details, but dmabuf is the way to get the bulk of pages into a pool within the net stack's allocator and keep that bulk properly refcounted while. An object like dmabuf is needed for the general case because there are not going to be per-page references or otherwise available. What you seem to want is to alter how the actual allocation flow works from that bulk of memory and delay the free. It seems like a different topic to me, and honestly hacking into the allocator free function seems a bit weird.. Jason