From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0D12BC04FFE for ; Wed, 8 May 2024 17:02:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3493D1128FC; Wed, 8 May 2024 17:02:11 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PMWErUa0"; dkim-atps=neutral Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id D786F1128FC for ; Wed, 8 May 2024 17:02:09 +0000 (UTC) Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a59a5f81af4so1214800566b.3 for ; Wed, 08 May 2024 10:02:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715187728; x=1715792528; darn=lists.freedesktop.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=w63SX1W8IWtKWaRdVmF8DRJBTDth/aiRDPCWeP/m/u8=; b=PMWErUa05PaeHTgbxpSnnmHyYuxfwozcdNXbxxmDUXZwADuMQApPf1aZDKmPcezaYa iJlufDdP4htFVKJLvz6VaDMn5fcZLlPlRmsWxspSB+gdME5MbrvCX2zeTfFKZ2VQ20ou 0Mh8BTc0POZQ9Rc8Ko/iq7/WPSCWRb4W2ZTwo/PdjXE4b/j5XZ56+OSVfFc2svie5diZ H13021YPdKaReCOThTMiC1cGtkl8ogmo5UXiyUewc1gKtJw6yWF8Ed23IEp00fz+b0KY zT5VJBiMZZshhsTSd497wmmuJYkqSro8mRqN9/5e/FY6UM5+R8RfKx5bwZktG6n+i4C3 jM3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715187728; x=1715792528; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=w63SX1W8IWtKWaRdVmF8DRJBTDth/aiRDPCWeP/m/u8=; b=boAhoVVTZbkDidiVLe7/AxBhZbtxRjEE+JL2TqPSmrHM8gdi4qskE7zLiTc9YOkm4F bEAiGVavxMEEFvhfKvyw51OtA6EV84BMtbmx1vU3XOCTKR5TUVJ2LTlSlDFbK6DVxFMo AVqNJjrey+sXmboQmjFcsGSo8ipq+YtcIzh6dUgAL83sm4HXjwXNfIslMNv5uYo0e0BK SD1yKvcmt0CQ9OX110p4etc5SZOoADg9sFZQsguPdkkdxCWpys2N2bgTGv5HtEIBPMtD BCSeip6J88kN4cO7Xk3U6PFXq20Y1DgbkE5LBPHB9xAZHy+yKdR3z98rKHSiJ/Prb5AV cutA== X-Forwarded-Encrypted: i=1; AJvYcCWjPNodcH5kv+AYJ9cYjvD777GxzK1e25uvYT2q5nePFBQ8ifDa/4s5LCgv8yFGAp1Yv8vo4J6kzh/lOb/wQddPEUY0+gTWYmy5dzOlR9wG X-Gm-Message-State: AOJu0Yx9PLWz9pY/9fBzWg5WtI/9SN3BTT/z4DJF6i0E+urCNCIjmqIj LS1HSwuYEAzSmcMfSCHN+zCsed1qlD+duriIXbNffTyBe9ybUhUF X-Google-Smtp-Source: AGHT+IGnIbHLe2S57apepPi+KOdstUOemuaNblSGc79A9OnsYp187XWHNbGjxYPqzEX3412l6BXKTQ== X-Received: by 2002:a17:907:7286:b0:a59:bacc:b07f with SMTP id a640c23a62f3a-a59fb9d6452mr265356266b.52.1715187727754; Wed, 08 May 2024 10:02:07 -0700 (PDT) Received: from [192.168.42.40] ([163.114.131.193]) by smtp.gmail.com with ESMTPSA id n18-20020a170906841200b00a59a8a5dd15sm5634228ejx.206.2024.05.08.10.02.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 May 2024 10:02:07 -0700 (PDT) Message-ID: <8ced4c49-d153-40fb-9e62-0a5784cfa864@gmail.com> Date: Wed, 8 May 2024 18:02:14 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH net-next v8 02/14] net: page_pool: create hooks for custom page providers To: Christoph Hellwig Cc: Jason Gunthorpe , Mina Almasry , 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 , =?UTF-8?Q?Christian_K=C3=B6nig?= , 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 References: <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> <20240507233247.GK4718@ziepe.ca> <1e2823db-504b-4829-856f-3f45a45ccada@gmail.com> Content-Language: en-US From: Pavel Begunkov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 5/8/24 16:51, Christoph Hellwig wrote: > On Wed, May 08, 2024 at 12:35:52PM +0100, Pavel Begunkov wrote: >>> all these, because e.g. ttm internally does have a page pool because >>> depending upon allocator, that's indeed beneficial. Other drm drivers have >>> more buffer-based concepts for opportunistically memory around, usually >>> by marking buffers that are just kept as cache as purgeable (which is a >>> concept that goes all the way to opengl/vulkan). >> >> Because in this case it solves nothing and helps with nothing, quite >> the opposite. Just as well we can ask why NVMe doesn't wrap user pages >> into a dmabuf while doing IO. > > You seem to confused totally unrelated things. > > For short-term pins, that is pin_user_pages without FOLL_LONGTERM there > would never be any point in using a dmabuf as the pin is transient. For > long-term pin dmabufs in the block layer absolutely make sense, and I Well, the example fell flat, but you don't use dmabuf when there are no upsides from using it. For instance, when you already have pinned pages, you're going to use pages, and there are no other refcounting concerns. Unless there is an advantage of dmabufs over FOLL_LONGTERM that I don't know about when used with normal user pages. > wish io_uring would have just implemented them from the start instead of > the current fixed buffers that are not quite as useful by not > pre-mapping DMA and not supporting P2P. fdget(dmabuf) would be horrible, I assume that's not the suggestion. But then it's really about kernel internals, and theoretically can be patched to wrap user pages into a dmabuf and pass it in. The tricky part is how that "pass it in" should looks like. Keith tried to cover both pre-mapping and p2p by registering dmabuf and passing the mapped addresses in an iter IIRC. Anyway, this discussion should better move from to block/fs lists, if there is any interest. -- Pavel Begunkov