Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp994571lqj; Mon, 3 Jun 2024 07:17:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVxs/UPtzh8eun/SXBvjSqNztkqlTQM5BvS64QpTPyNwk8v/73Y5bz7VnlNtbhrdTZ34wGt0rAB+kNEz/pmhmcTWmimUQjRQzdEnpwy8w== X-Google-Smtp-Source: AGHT+IFj5uAbtw7Z8lRVlWkwI4PCTKC9Xz8nY+hqwXgOUw/LEArL7K07ZFfMOKPtNQrsC7Y+sKoX X-Received: by 2002:a05:6808:1a26:b0:3c9:c7a0:94f7 with SMTP id 5614622812f47-3d1e34739demr11813746b6e.1.1717424268162; Mon, 03 Jun 2024 07:17:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717424268; cv=pass; d=google.com; s=arc-20160816; b=POZhrnmIsuT5uMRQriVZn+76642vyIX/W5b43TqLWsHLk6y1gehHtzH0WNJZFm2vEP SvPN0szA/L0uHrcYgtrC9TgiA47vC4FoNX2HqlACrrDMDL39dpuPbDHOutm240kaTaSH O3XqKDeHQkhdfzhCdOHjbX3xXPND7CzEER4WINYX2L8ftKDoXPC8QUqOpmblfgo3X1GS w9+E/Ln1PudjUYgwp/NSXWFahGWLu+T1Cc/SdXgouSP3exrRtNphMR9KzAfsN33NCZmq mZTiwu87v/Wd6gE6gZexwSg+PJ5klkfIXpGoWe0mcM06HJ3xB4B4CoFsMwcVi8nOHM4V 3OvQ== 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=hX960fiFK86sEZShyroAmINX+eMw+I3MOlcUpYKxHw8=; fh=f8Gov9Ay26YGkYsOLP5QgxxLBE3SoAR3fioralVGrVA=; b=k8yNjyBD8g8PnfuzUoqb4MKDDHOvs2QQGT/vHTwhggI1yAAxa9Rer9snuImfjEN+2+ cnjYA7D7vrIjdFoiARr6WJFhkF+B37wErP8cTEct7kAKHpQoIsP0IrqWMsW9Kfprdz7r EFPs7O9vwzVhQAM5prDkkExPucMeucpA6+H6snp2DVZKHl6aqv+G88Kk86yGbIbDvwC3 8Q7cgyiyGpo6SeRfaY3zD3JKn9SCjGYMZuTsahbwOcbENXPhE23QtG2zFhGF+Nf+IHYa 75AnNNG343oEaRXdGyEvCwrOhMh4QUgIS9N16Ky9DNGPv2erpdkUD0/TXWozLCbFOaps e+oQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=rLzUrvJN; 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-199274-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199274-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 71dfb90a1353d-4eb23c15cf4si234682e0c.74.2024.06.03.07.17.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 07:17:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199274-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=rLzUrvJN; 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-199274-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199274-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 A9F3F1C22066 for ; Mon, 3 Jun 2024 14:17:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 73B3D12E1F9; Mon, 3 Jun 2024 14:17:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="rLzUrvJN" Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (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 46FFC757E0 for ; Mon, 3 Jun 2024 14:17:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717424245; cv=none; b=YCpK2LyRx+qAMFZzd8DxKI9M/DK/8jagggb37kTCJuNAma22EjccpclU8RH4QZeGGWVHrgkx2DSM1CWzkW+8trPhK4gXWfqVkaSooTaReFAMwhNX1wdpnOmVnkhUBBrYSolDCv1j5hUUwfc/2neqno35/RfSlfsAJqSXsBsZUjM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717424245; c=relaxed/simple; bh=HKIk/fziZZuLGu58aSs/+3iSct4B2ZtBElSDQxdl5rg=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Sn59ClksE7Y/E/n9SK/UK1dHj9P9dBPkxjL1FCIy60JT7FQsQw/yT4CjTaBu14CQsyU09ASki+JC4xThukPCmjb13oAT5tj8cEW4FERyimp2PmymxGRc5MEaj1dwrnvyL2jwTsPa8QZ2Id5aNHc4R/kaxBmgriBpFri2j4N7SjA= 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=rLzUrvJN; arc=none smtp.client-ip=209.85.218.41 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-f41.google.com with SMTP id a640c23a62f3a-a68b41ef3f6so199921366b.1 for ; Mon, 03 Jun 2024 07:17:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717424241; x=1718029041; 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=hX960fiFK86sEZShyroAmINX+eMw+I3MOlcUpYKxHw8=; b=rLzUrvJNelG5IifUyrBqPAuZ27DXkGZdNLTVIgE2RqSs5A9CsgD5a0aaaIiKhm2CJ7 XSfqjyqppFk6v7c+gwrCBqMQoS1VNXZnknkjzOy6lORVOYwDrFYiGULyBnhFNNeiqSVM ZtsYYdsil+io5g5BBgmWVjP4z3BMxEL7J8+gPKJ/9HdCDUV4IyE9094HWD/Bo/SrM1a8 fRPXzYAQHspXUsJcY1dNhiLnldU7POcqj89aVM7MPFMdukQSSPLkyqGgOdueDXL2AxHd ya/iH/QiL7ZR1wMDVu/LdOm3wLpPYIYoDzqcaBmc+Uaoas13AP0GYWillEcgKkRA/G3K 6c5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717424242; x=1718029042; 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=hX960fiFK86sEZShyroAmINX+eMw+I3MOlcUpYKxHw8=; b=IObKN/cG3Hxe7/UhZ6nSvUZVwSre2de54WDEMQyArOiZXaq2d1HhA6GxzE21WfppC8 7PoXQBmI68A3kshnld51dtbSoo44Drv0pnyDITdgyXpB7UKhB7G5Ja8CVzEnEAplHHAn KWO5x1hDOstPJsE76Af7teU99nmOCTQ4J38mmcPhfbbaJMVond9ScRad9Js6ZbDRRVtB BGi9BklYjSjaKm6t684ThM8GNOM4I3lb2H9xlbQU05KGWBfDTYA4AKAzd5RRIdGNZN0f momvnvMHtcsqErbxo2tsOVwIwNsh45ALmBP87r/NA4ihjFie5hIBvQd66dxjBsXpt+ws 8UaA== X-Forwarded-Encrypted: i=1; AJvYcCWSIOgPVD/XdfhPqn+w1BwQxfgD8QX3cCiQaHtkd8dID6J4WtMkKCD9amdhvEX/YohVLKpn4rngZwwqg9gpXUxV39axLnTFMCpLpHnx X-Gm-Message-State: AOJu0YwIaEmlYOdi+wszT86Oyewjw8ZGb04GwWdAQ1e5G90Hu3nJcjJo Umzyp7WhQYReN3k1pvjEyGV50cIym0wFfZY7AsBpieRvgOtrIlCABctfkkqC3TkiYR6GNoeotdE l+Bvf2ddN4r9MVEyAC6UCHr+aSvKx9kqMXinN X-Received: by 2002:a17:907:914e:b0:a68:9621:a93c with SMTP id a640c23a62f3a-a689621ab6fmr371329366b.8.1717424241215; Mon, 03 Jun 2024 07:17:21 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240530201616.1316526-1-almasrymina@google.com> <20240530201616.1316526-3-almasrymina@google.com> In-Reply-To: From: Mina Almasry Date: Mon, 3 Jun 2024 07:17:05 -0700 Message-ID: Subject: Re: [PATCH net-next v10 02/14] net: page_pool: create hooks for custom page providers To: Christoph Hellwig Cc: 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 , 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 , Shakeel Butt , Jeroen de Borst , Praveen Kaligineedi Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, May 31, 2024 at 10:35=E2=80=AFPM Christoph Hellwig wrote: > > On Thu, May 30, 2024 at 08:16:01PM +0000, Mina Almasry wrote: > > I'm unsure if the discussion has been resolved yet. Sending the series > > anyway to get reviews/feedback on the (unrelated) rest of the series. > > As far as I'm concerned it is not. I've not seen any convincing > argument for more than page/folio allocator including larger order / > huge page and dmabuf. > Thanks Christoph, this particular patch series adds dmabuf, so I assume no objection there. I assume the objection is that you want the generic, extensible hooks removed. To be honest, I don't think the hooks are an integral part of the design, and at this point I think we've argued for them enough. I think we can easily achieve the same thing with just raw if statements in a couple of places. We can always add the hooks if and only if we actually justify many memory providers. Any objections to me removing the hooks and directing to memory allocations via simple if statements? Something like (very rough draft, doesn't compile): diff --git a/net/core/page_pool.c b/net/core/page_pool.c index 92be1aaf18ccc..2cc986455bce6 100644 --- a/net/core/page_pool.c +++ b/net/core/page_pool.c @@ -557,8 +557,8 @@ netmem_ref page_pool_alloc_netmem(struct page_pool *pool, gfp_t gfp) return netmem; /* Slow-path: cache empty, do real allocation */ - if (static_branch_unlikely(&page_pool_mem_providers) && pool->mp_op= s) - netmem =3D pool->mp_ops->alloc_pages(pool, gfp); + if (unlikely(page_pool_is_dmabuf(pool))) + netmem =3D mp_dmabuf_devmem_alloc_pages(): else netmem =3D __page_pool_alloc_pages_slow(pool, gfp); return netmem; --=20 Thanks, Mina