Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp593893lqo; Wed, 8 May 2024 09:00:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXzyWFP865C1gcSGcrj+ywIQ598SKryO0w3cYDCuk4pC7NxINgRTOcpNyZTLUxw/HMiq5kpiMvAByCRH0ITPdyVOoKIw5rEZYvq8n3TJQ== X-Google-Smtp-Source: AGHT+IEQxQ21A41e48eR4lGpLHa+zh0/Ja3NDZVKCSSmqL1RoX+QHIcBBMXajFrmg3sosdxDyvoO X-Received: by 2002:a17:90a:eb0c:b0:2b2:802f:e90a with SMTP id 98e67ed59e1d1-2b65ff18cd3mr70966a91.24.1715184012398; Wed, 08 May 2024 09:00:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715184012; cv=pass; d=google.com; s=arc-20160816; b=QPO5/udhOQ/YYE2wUdfpWVCKqMJU/cofkCfVBjASc/0KEgw/4OPTYUo79+BIUxLUey pHOMe1XDnDClz7KLhIKqC6cdP1K38zccYfpuQa8YAY8ytM/9PTG7vZcAkp+3Ou64d5vW YMLYhLTurRUzRMgRn18aBuwWFjisLetXCWYKmflLUrZh5mSMO4k8B/DzLtshRQC8/sYG 4L4bgOZatoOKAdTk5SHzcJFuGDew8aL796iGhc6wBXd+baCeOP/l2vHwwxfCThBiEMZl Qm9o8qSZYplhiJDHKkYBLdJwglvAHIxyXJvrc3F5M0v5xPcYszy0769iibTL7aK4+QJb S3hQ== 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=fqoHV1aKLMbHVQjAORL2ZSoTVMVXNqsiEWwcIT2cGHs=; fh=F4I0w+J2odq7CTxZWRcfWFMRpoxc2qZ/PvdP1Mlnbc0=; b=WjbGfJoYtAbAfOeG1ekE//BmM2OboBQyjX4HAKB9maIB7JW9n3Q3rvOvnP9dzCznzp FunxuSgE7GG23WEGbPBciebvgio1r+79ARXGzRms7A8pX4dfIRoGSTOUS+cUHzfyx7vd Mo0L4i7aqpceD8e1zyenLzFgRak1KRoztcsgUHZqf6OG4NTQl2XkIakty/3DKFGkylsF FMFsZoMKbGPPHx1jTfXh48fPk7XwXG9ESABT5cBhFvpmG0M27VO5DiiK31prM5KzD+Mm x0pvOaZOECxsrk9DWkJ7eOQgYDr9i5Ah6e5Pjvf7MSA/WC2PFVbBXO4brr1YdZdzOi74 s30g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=KUiojH4L; arc=pass (i=1 spf=pass spfdomain=ziepe.ca dkim=pass dkdomain=ziepe.ca); spf=pass (google.com: domain of linux-kernel+bounces-173519-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173519-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b628868793si1652959a91.27.2024.05.08.09.00.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 09:00:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-173519-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=KUiojH4L; arc=pass (i=1 spf=pass spfdomain=ziepe.ca dkim=pass dkdomain=ziepe.ca); spf=pass (google.com: domain of linux-kernel+bounces-173519-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173519-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9E1E7281CDF for ; Wed, 8 May 2024 15:58:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B54012AADC; Wed, 8 May 2024 15:58:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="KUiojH4L" Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (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 63BB1128815 for ; Wed, 8 May 2024 15:58:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715183899; cv=none; b=O0We5QvjOIzN0YnP3C51cnNJbomFrkppfz0stEi5bhrfEFuP0nL+kJJQwwcbezvYGYY0DkZ485u6MWeQFvq4qF7AHXuDV6kyAMdq0wwpZXdhWX3dm08aqwvUkoBf/xg7r7JuWEoiBzPIwlX4F27v85rVX2n5jPfNCiPaV7LvWug= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715183899; c=relaxed/simple; bh=8Q0d5ghL7esSJXn5530BhC5obw3iPkePfl6coMCDXmA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hK3d8YLCUDc2SZU8l/fdMf7XlAdoaqgsR63y538H5P0e3iVjDii+KmSdZLx7WJDSqgf8/WTyenyaBPz04EDrvn6SOIA1WlEaWNCzJ75/R6uzBDGXODx4p6LhfCNHYVPxzSBnqwkEXrat/WJDTtq/1VRZtFIidoaJw1kI05Smj7c= 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=KUiojH4L; arc=none smtp.client-ip=209.85.222.176 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-qk1-f176.google.com with SMTP id af79cd13be357-7928ec5308cso97827385a.1 for ; Wed, 08 May 2024 08:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1715183896; x=1715788696; 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=fqoHV1aKLMbHVQjAORL2ZSoTVMVXNqsiEWwcIT2cGHs=; b=KUiojH4LesQeeoO6quuwR7nVjh0RP2E6XcLvhsjVb4t5nlyf0ETS8m29ozIxD60OV0 raxqXEVFi4A0cm5S6doHh9fCFJB2LZkXOCOZqdd0MWi1bG2I9fn6VQAc7aX9V9HyFjfm jkY4Voiau7v13ScYtwzTUFfWP1Z05UYDYHO8fLz8y5hI8Pz/5gVJMTNdgL7N+rkGVquI 8DtYHnsIzd6IbHy0zAMZOMfF497TOkBvb4SM9uYKX7ms7wlWy879pnjeNolmq7Pyuv72 ZlBEbrpqQhGGoUE8PIRfUuYPaEO8bg4Z/SiZRZ42jHR18qASdlV7o8rIEDN7Ufp8U7PI TgOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715183896; x=1715788696; 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=fqoHV1aKLMbHVQjAORL2ZSoTVMVXNqsiEWwcIT2cGHs=; b=GfrBuCgEl3jdyyBWYKhKeRjRn/x3DdfX04Ip+dU9Hs8x2LgDPwFoj6yxfFW+RsYqpT HtawrpyPrABXqN8qcX91Avf5yE7F6cgC3EBKLOkSSzNxCce8rj3o4rfpUOeNqxDUCggz O+LPSY+DjhAsi7/9iX4ZSLbUsyhOi5YdZ3jtrIM4PdyaTXSzyqED7axmwVjWKRT0rwZO EkYqLe9IY8sqOdAnTfUEy0me43woPKzKakDqECyBy32NuNGPrehaQ+AnKQb07QAizNs7 oAI7jGFvAu0li0ucEvUVW5NYsl9iix4aAkQfdi9S1UqKk6PqsU/vFMXkFKrwqoUzR71o 7H3g== X-Forwarded-Encrypted: i=1; AJvYcCXBk3v6UTlaoQNmbM3lIn42yHgKFdhT/TY1A+276FR9zOuWMWPGlO0T+nnHrpkdgfauqD72u93Mtohlg+cRar/RLM8o5TZ65vbbdLyz X-Gm-Message-State: AOJu0YwWXnjnghfcF/QWeAcFNMDhwGvk5STAKjK30X4DhsQ/XUqlYY7q HVcz+CYpOu1MTopROa9r0ZJ+9YxpS5ZL6dDxWRm3tcq3voaa7NFEmn2o8Hn3mdo= X-Received: by 2002:ad4:5f85:0:b0:6a0:a4db:b297 with SMTP id 6a1803df08f44-6a15cc4e35amr1166676d6.23.1715183894191; Wed, 08 May 2024 08:58:14 -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 pm21-20020ad446d5000000b006a0d057073bsm5684884qvb.58.2024.05.08.08.58.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 08:58:13 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1s4jgL-001JCw-43; Wed, 08 May 2024 12:58:13 -0300 Date: Wed, 8 May 2024 12:58:13 -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: <20240508155813.GS4718@ziepe.ca> References: <20240507164838.GG4718@ziepe.ca> <0d5da361-cc7b-46e9-a635-9a7a4c208444@gmail.com> <20240507175644.GJ4718@ziepe.ca> <6a50d01a-b5b9-4699-9d58-94e5f8f81c13@gmail.com> <20240507233247.GK4718@ziepe.ca> <54830914-1ec9-4312-96ad-423ac0aeb233@gmail.com> <20240508142530.GR4718@ziepe.ca> <6f69694b-4281-45a6-92aa-d9d72b918df2@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: <6f69694b-4281-45a6-92aa-d9d72b918df2@gmail.com> On Wed, May 08, 2024 at 04:44:32PM +0100, Pavel Begunkov wrote: > > like a weird and indirect way to get there. Why can't io_uring just be > > the entity that does the final free and not mess with the logic > > allocator? > > Then the user has to do a syscall (e.g. via io_uring) to return pages, > and there we'd need to care how to put the pages efficiently, i.e. > hitting the page pool's fast path, e.g. by hoping napi is scheduled and > scheduled for the CPU we're running on, or maybe transferring the pages > to the right CPU first. > > Compare it with userspace putting pages into a ring, and the allocator > taking from there when needed without any extra synchronisation and > hassle just because it's a sole consumer. Wow, that sounds a bit terrifying for security, but I guess I can see your point. You are replacing the whole allocator logic if you are effectively putting the free list in userspace memory. Jason