Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp1642321lqz; Mon, 1 Apr 2024 12:23:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWuxtg1YECKUar6QxtmwCBjYf+s8hWJWy5cuNsnQa+TqptKo+ock1TfSCjzIsv1CqeU4zLdqI4JmUbs7f68n4/moJIYC8vVgkG2Z/ndrg== X-Google-Smtp-Source: AGHT+IFtrBVzv2LLRuzBzS0aB5W08rJhsGbmHe9XFnqFo/p1I3qIai+RP1IQQJ+Kv281t40B7CKU X-Received: by 2002:a0c:f64a:0:b0:698:dafb:ae27 with SMTP id s10-20020a0cf64a000000b00698dafbae27mr17473621qvm.7.1711999382342; Mon, 01 Apr 2024 12:23:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711999382; cv=pass; d=google.com; s=arc-20160816; b=Lh//471ixdzu86b3qGxu8ImfL9X5tv5Lv0Vp5DTAxS/fELdES/AUnD6mXYsnB8hOYV 87mqqFegJ/PMwNbE+q2ieSIRmDfepK6jGxq12b2afWjOuxg6FMPr5UZBYeFTCoHj0TLa WigR0LGQqXg542wXuU0jzT2lMFZFU2qxn31HHkKkPkHXaek1cjscfVzVXJeBgnOkV1AH tIz3Cf9/MK88J0aVVTr8mjSl+b0n+03U4ByjiBvpahihMfYM80/5jgeVU6wpFY4TlsOm 0GAZpup2sP0wRXLRc0DeaYyR0q+CjMqKOBadheeFyghevsL8PA41OxAH9r92nZd9dxbo 8Z4g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=pRKdoK98qnZzkUcUn3OGBOuDQ1g75ltD3kRhKb3BL0c=; fh=pkRfvthO6Hjnd2Yd0+V7ZR6cZViWKy1+eehjVn9lGoY=; b=t4whwCxcIw+pjynrhGyhxCTDSEnM2VbTUwxa++BRaLaUb5wHkKRne+K1vo+HTf2F+8 Ja48S7ukCvzfg7Qg0Fi9sQU0lYVSxMhwmT4GIoCVqYKLwSgqzyryB04Z6usujXJ6J7sY GB78uvJjPz2FcOVQZg4xrxnRaDbYJQQwxFajejvFCclQ+Jwr8KiHqITxs1end9ocKvSM pO8/akqLeSI/cPtU8SXzjEzjtj9PtUqorUgohjR2H1bYzG7z3NZSwBhgHj/CFSP/2MdH Vc2l6+7B45T21+vf8Y+NQb/RpaABGqOCFQlEUIj+ToM2Y3PyeCFaSgnZaYQKbM2M9Sih U31A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=22uWaDKI; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-126984-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-126984-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t2-20020a0ce582000000b00696b12259cesi9994173qvm.334.2024.04.01.12.23.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 12:23:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-126984-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=22uWaDKI; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-126984-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-126984-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 095DA1C213EF for ; Mon, 1 Apr 2024 19:23:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D90EC52F70; Mon, 1 Apr 2024 19:22:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="22uWaDKI" Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (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 B051053364 for ; Mon, 1 Apr 2024 19:22:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711999360; cv=none; b=onba1RkDxavBsCAfiUULEOG5NagUUl2yf07e1nVpfx9yFoumY80CfeER4dal3zV0w/zzF7ubmUblt1MuZDvVSDzKnY2Iyg9a8TKrGDMk31qdmJQ69vGmSqKQpifvthiZdtnrSvNwc/rg7fTvvynSE2t+WGLlQgY3E1V9DPUNgXM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711999360; c=relaxed/simple; bh=8oUFGMmpkpqLpkNpA3EMKT/yDO5+7f6Bm1WN7AwolPE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=WYLi/tfjQqypM4wmkE2RaOPW1cxc1xsCS1vr7JWUmT00T6Q1P8+Y6u9wiVfYJ775lrSrpiwQVrusHKvjNXU2v+Vq5dEpQNhVNnhsyMyyBHXxj/5u62+xCU2pSpS9hx1hEoeEnq1SxDe5IShW2b79uimGSFDzjUV6ojfEHxTOvsk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=22uWaDKI; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a4e7e2a257cso71755066b.1 for ; Mon, 01 Apr 2024 12:22:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1711999357; x=1712604157; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=pRKdoK98qnZzkUcUn3OGBOuDQ1g75ltD3kRhKb3BL0c=; b=22uWaDKINClGQOvJi06fBpyOOT7pMDPbf3vKhzp0A0EZNqEMJZEU9ZEQI+hZSku6MG bDpe0EjXvO13ddBX37ofmNnPNsgpJXqGc4AuCCQ8nuthzsZBfIFoF3l84MfjgVpQ/rMz X8r0RgAF5nL/37G5R4ZMVUu7g7ccxrgvXJyBok31bWJ4U/eF8uRTx4l9dRQ4jGtBlNPe xA9xU5PEKcZ6Mo8JfTxnSnXSqVcfGA88I4+hdQ1b5EIF6VP5bvS6Re5X1nESesLYTzOM keFQM0jW7oXypgbtrwSnBZZnye/NvRo6H4FNnGy3aoPjs0A0kSwZBaIAE8vZ+9L09KAa hy5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711999357; x=1712604157; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pRKdoK98qnZzkUcUn3OGBOuDQ1g75ltD3kRhKb3BL0c=; b=QfndkdeVzcMQf8/DXbyyQjxvcEvXbhma6KBZkk0kR7iRM+b0oFWsYRDpaCaFQ0Qdjp ZReybCMOg23t9rim/NXQDtT9QYBaJSIu5FT743r9pbv0OyX/Ux9LROFKVn9k18HnhEEE n4AfE3T7vnDvxma9ykD2kRDiVJ+iBmGglqDy7/5swl6RJaS5cv5L9cW7Br3ueTfy56UU hzOqYhtzk+cibKB7KdkpZ7LipP/JN99IEsmNvkf21Rw3xNECNHugwY2Zq4QPUnHQPhjP t9t8dAac3ztot+//9I0MGE3RtzhiDu7aAabyBbTbkWPZxWZ5uEQVPvFKsVvWVaQcXDVs k35A== X-Forwarded-Encrypted: i=1; AJvYcCXg44iU4v8fHiAF/RvDo7H0ZHjWPaD+99BqtpqtvexHrUyyYt1+aYKnORQ8BXStb4zP3qIXfxeOGCgha+0CVibaiYgM4cvvQIVxSZHE X-Gm-Message-State: AOJu0Yy0cXMaI6wJm+DgHcGaQb4zc5uhyxMn3j9i1+9xXsJYuzG7Odjq CrFzOatfM9ehYBd60IBLJV9n4yzJ+u9d4NpMonwqQpHljTyiR1EcciIZK2pld2d8jzgsF63gPtg 100/zuUY5ffHYpgoIu+/GX+F5wv0aNqcmunUR X-Received: by 2002:a17:906:f289:b0:a46:d978:bf02 with SMTP id gu9-20020a170906f28900b00a46d978bf02mr6594862ejb.34.1711999356578; Mon, 01 Apr 2024 12:22:36 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240305020153.2787423-1-almasrymina@google.com> <20240305020153.2787423-3-almasrymina@google.com> In-Reply-To: From: Mina Almasry Date: Mon, 1 Apr 2024 12:22:24 -0700 Message-ID: Subject: Re: [RFC PATCH net-next v6 02/15] net: page_pool: create hooks for custom page providers To: Christoph Hellwig , Marc Harvey , "Cong Wang ." Cc: shakeel.butt@linux.dev, 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 , David Ahern , Willem de Bruijn , Shuah Khan , Sumit Semwal , =?UTF-8?Q?Christian_K=C3=B6nig?= , Pavel Begunkov , David Wei , Jason Gunthorpe , Yunsheng Lin , Shailend Chand , Harshitha Ramamurthy , Jeroen de Borst , Praveen Kaligineedi Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Mar 28, 2024 at 12:31=E2=80=AFAM Christoph Hellwig wrote: > > On Tue, Mar 26, 2024 at 01:19:20PM -0700, Mina Almasry wrote: > > > > Are you envisioning that dmabuf support would be added to the block > > layer > > Yes. > > > (which I understand is part of the VFS and not driver specific), > > The block layer isn't really the VFS, it's just another core stack > like the network stack. > > > or as part of the specific storage driver (like nvme for example)? If > > we can add dmabuf support to the block layer itself that sounds > > awesome. We may then be able to do devmem TCP on all/most storage > > devices without having to modify each individual driver. > > I suspect we'll still need to touch the drivers to understand it, > but hopefully all the main infrastructure can live in the block layer. > > > In your estimation, is adding dmabuf support to the block layer > > something technically feasible & acceptable upstream? I notice you > > suggested it so I'm guessing yes to both, but I thought I'd confirm. > > I think so, and I know there has been quite some interest to at least > pre-register userspace memory so that the iommu overhead can be > pre-loaded. It also is a much better interface for Peer to Peer > transfers than what we currently have. > I think this is positively thrilling news for me. I was worried that adding devmemTCP support to storage devices would involve using a non-dmabuf standard of buffer sharing like pci_p2pdma_ (drivers/pci/p2pdma.c) and that would require messy changes to pci_p2pdma_ that would get nacked. Also it would require adding pci_p2pdma_ support to devmem TCP, which is a can of worms. If adding dma-buf support to storage devices is feasible and desirable, that's a much better approach IMO. (a) it will maybe work with devmem TCP without any changes needed on the netdev side of things and (b) dma-buf support may be generically useful and a good contribution even outside of devmem TCP. I don't have a concrete user for devmem TCP for storage devices but the use case is very similar to GPU and I imagine the benefits in perf can be significant in some setups. Christoph, if you have any hints or rough specific design in mind for how dma-buf support can be added to the block layer, please do let us know and we'll follow your hints to investigate. But I don't want to use up too much of your time. Marc and I can definitely read enough code to figure out how to do it ourselves :-) Marc, please review and consider this thread and work, this could be a good project for you and I. I imagine the work would be: 1. Investigate how to add dma-buf support to the block layer (maybe write a prototype code, and maybe even test it with devmem TCP). 2. Share a code or no-code proposal with netdev/fs/block layer mailing list and try to work through concerns/nacks. 3. Finally share RFC through merging etc. -- Thanks, Mina