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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F5E0C77B7C for ; Mon, 23 Jun 2025 19:09:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CDFA26B00C3; Mon, 23 Jun 2025 15:09:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C90016B00C5; Mon, 23 Jun 2025 15:09:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B7EAE6B00C6; Mon, 23 Jun 2025 15:09:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id A79AF6B00C3 for ; Mon, 23 Jun 2025 15:09:26 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 1730E1609DD for ; Mon, 23 Jun 2025 19:09:26 +0000 (UTC) X-FDA: 83587603932.07.89D5AFA Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by imf03.hostedemail.com (Postfix) with ESMTP id 303D22000F for ; Mon, 23 Jun 2025 19:09:23 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=RHZB9BTk; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf03.hostedemail.com: domain of almasrymina@google.com designates 209.85.214.175 as permitted sender) smtp.mailfrom=almasrymina@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1750705764; a=rsa-sha256; cv=none; b=YpU1edRPys63BNBNTNGZ3664mQvJCos6SphraGOnYPaUFSigOB89LTnfOIuSnSDdi+ye0k 2due5XX6md+9WKGvmAIA4xpxlamqfoVdJQjgqNEPvojHEK4iIc+kGbyQi81RV/6BeL8P4T fLzY0U/NoZ0qGbWLKB0CbTuqM84gIT4= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=RHZB9BTk; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf03.hostedemail.com: domain of almasrymina@google.com designates 209.85.214.175 as permitted sender) smtp.mailfrom=almasrymina@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1750705764; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=cp/0chDgm2snxzxzq95eP+vthqt+mdAU4GERCYRoDSo=; b=poXU1Xf3E36Fpow48RHPwo/rXjAWOUTL1KMVH2X+oF9Q5CpWVAqCI2U/FT/SxJv9SNF9wR hkUcbyoxrN7h/UyRi7EntVOf05ejd8Rpasq8BpHujj52nXryOQykHuh4Yl3Eh1GQmi3zvC hSgknPHU2VMFFcEtrptQKWc51XtHRcY= Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-2357c61cda7so23885ad.1 for ; Mon, 23 Jun 2025 12:09:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1750705763; x=1751310563; darn=kvack.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=cp/0chDgm2snxzxzq95eP+vthqt+mdAU4GERCYRoDSo=; b=RHZB9BTkcNwg0kddV1O3EfGZjufSqSV1EiLC3eIjrRu0kbEqa5OKHWDUch7eswFQM3 XTkXHH0E4LtJvkgnC9T2wnI6J5AV15WQWRjeTj0dpGF+p3emzOfiMyvOo1FnIpTbKYY4 FOjSK2ui+rGjvejhInUNemVsVR8iYHD1VQvUnx4SOKaVDA+Yi/+8MVLGPfpI7pSujrcw PaZTmOT/7k/abJjJXw56MLh0DmZ7Av/VDaCKxpXXvJuM02XXPkf1mRrkJNEaN5j+6Msi imc5StVJuCgQzfPKxKo/hU3NEw6WmBDiBt0yvW87RH4aRv6e2loo1s04wrrGvgtK1u0L dBqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750705763; x=1751310563; 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=cp/0chDgm2snxzxzq95eP+vthqt+mdAU4GERCYRoDSo=; b=f6Y0KmfVk2VAR+orvAEplvbmVDQ7gYtPdqr3ERJWaaZd7/gXtU4DuxUWbscbmEwW7z mGBMFbi7VnCz5lmKxXequ4rqRnCl/Yc0RFOKatV6L96PZiSoJ5O6J/inSD0iwwS2fWjS VkmH7V9IBQx02fpushxsnUDmNBI4ThRnDCPAVD9IkOUUwGESvHKIbBXVafvMqJlEEl+F XFxUAHq/4O6DTIDUMr4FuRSWWk64YcvSUbizcbEp7yBhNlNqnMXi+8ACSig9BTtMLVZF cXklkFunElhKlWQh52hjVNyLuL206ztmyioQ7LWc/l0C3FdlF/PL3kLBa2j7zu2s/+GO aJ1w== X-Forwarded-Encrypted: i=1; AJvYcCWu7W/YXWO9MW5eaSKEWC+SHAs/7wSMm8/vDuddaL2jExpnuDlX6iYxg8fuTvbpXsEUf7P58kAazQ==@kvack.org X-Gm-Message-State: AOJu0Yzcl8Ld2d+rMgt3ca6MfRCM3rwPU9QVR4LcBXLQJdO/DLbovw46 gqXl1oSLlkl9TBEyi1ZUZVd0eyJcVOHiPofHd29vouraaHk3QVWBxFVT1rN+0Shf/6hKBHsYgvL zfS99Km+BsYWFjWQp1QByPcfyO/cVMQW4XAvICFRF X-Gm-Gg: ASbGncsiDkvOYeyna0b0tv6I5mlaU6R1ClxV7dTdxtXG+mkti4nNX/iMFJoTja+yqDQ 6QoBSCqySpEM/q/snXERI3E34CPUtM4hyjeBZfN1eo/XgV0ht6IBbTfoU98odav3sI8Ht4DNIh8 emrgEx1k5sz9C9FB+6etexa8XF2e58eNvddTmZaucXHpufiJj7KHxMeuuEi8kzCc1uNJZgqqoLz Q== X-Google-Smtp-Source: AGHT+IEP6CbJSMMIjAaNAJ9rOrnxvip7xFCbKZZbgsFvTLW3kA7gzinjehuUnzT5TsDabxmVW7mRkxDk9owGN0VC6EQ= X-Received: by 2002:a17:903:41cc:b0:234:b2bf:e67e with SMTP id d9443c01a7336-23802c66acdmr344235ad.13.1750705762491; Mon, 23 Jun 2025 12:09:22 -0700 (PDT) MIME-Version: 1.0 References: <20250620041224.46646-1-byungchul@sk.com> <20250620041224.46646-2-byungchul@sk.com> <8eaf52bf-4c3c-4007-afe5-a22da9f228f9@redhat.com> <20250623102821.GC3199@system.software.com> In-Reply-To: From: Mina Almasry Date: Mon, 23 Jun 2025 12:09:09 -0700 X-Gm-Features: AX0GCFuS5sYOE7MPEWKATp8YxIxvbHC-ghHV1COC2m3qIITA4p4mPOlFQEJRPtU Message-ID: Subject: Re: [PATCH net-next v6 1/9] netmem: introduce struct netmem_desc mirroring struct page To: Harry Yoo Cc: Byungchul Park , David Hildenbrand , willy@infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel_team@skhynix.com, kuba@kernel.org, ilias.apalodimas@linaro.org, hawk@kernel.org, akpm@linux-foundation.org, davem@davemloft.net, john.fastabend@gmail.com, andrew+netdev@lunn.ch, asml.silence@gmail.com, toke@redhat.com, tariqt@nvidia.com, edumazet@google.com, pabeni@redhat.com, saeedm@nvidia.com, leon@kernel.org, ast@kernel.org, daniel@iogearbox.net, lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org, surenb@google.com, mhocko@suse.com, horms@kernel.org, linux-rdma@vger.kernel.org, bpf@vger.kernel.org, vishal.moola@gmail.com, hannes@cmpxchg.org, ziy@nvidia.com, jackmanb@google.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Rspamd-Queue-Id: 303D22000F X-Rspamd-Server: rspam10 X-Stat-Signature: bkfgwt3ctccsehgphjnymxo4oqajwdmr X-HE-Tag: 1750705763-708946 X-HE-Meta: U2FsdGVkX1+knNXy2nedlYMZaKYtBwuBntL4zO1sYzPo3dURsJUdOaFc3mlZ1p/rricI65TSo0Oq/c8ScnBY3rcPwyDrflOaz9n0pSSuusJ26IvMZJfLv6pzSQoDPCpY0ObfVXbiuJsBi3aNPSMPZ0AeVe69elWbjNeI54uz8kYgeWszcE5IkDgczMZadSxzGV1BFHQ1PzDknGFc3cL+uF2lUNZ2znQs1fkGAfS5k5+5ogqPDpCrQubB2v++eP23kYEGxeHuYR0Z8ECHJBTB1mVrDXDgj8TXtwMblycfYabe0umIbsTLWClU+j+LFoJLyScABVtBmECK9xMPAiUc01146QyCe1MRQucFXtyezSKQSCMu7m5yRubPmv4qz0u7xpFTGF3G1barkNp76jp/n1CZvmdfl3PeZlXqUFS4wyicQv4Db743g96nbPyO0LApNnfc0JmWiFC1NVM28fw04If1HdWn/OyEo46gE6eZpXqKoaZgURyNBJklBCVTZTu4KzAOSJsuJwN5WoEcOSRDY40X/EAnp5b7OumT6n7eOSs2P+AACem6W2gQVXMRvvEOhubzNDaTmjbWfh9NLoYEPaT9HMFRrgFDINYxbROFS93kGKNPA0cYUsDDC19b5qQH8zVWNrufcozpWQUurMLXAMBPseh+ooaoqQKWCVm+9jD7wOic+NK5nnh0ZVN+rBs1jG2SEy7NXCGWXt6gQFqEsDwI6t5UJmHCHvQOpeKH42S3/YcqZ5r1UQbh4qctmFgP0aY60U32yzefYniyOAfJw95jGyzzMdRZ1u7DXb4ZYJPhr/aowNV6WdN5w81azFFjVWR9RnE9OaYSZq1B5lzf86LPa+Uek0MYqOIobk3PmBHAfF3u/O2xMtQrBa+ApSW85ILTuQJMCIbwJP+f5rpejFxqMAZ86gQuiETqOO+jUi8ErZcXLcLRes9KaOBbhwKqrxhwAGliqdpHVNTgfPx j7yXQkLS AnpcNG40KZluaiF2LjC1tt1eN0F1ld5713311rKOm00u6Tk7BMRDG0MhMDXMS+Wg2W32x7DaXc82P723FtrXL6dU1hHM0aoUSG8Phqh5eJxcN4NUsS/Dyjw4y9xKuRpPST27XrTMFbus6iV4s0KFkPk+uwvzzXgVgMK6lPVEYr3Zwdj643vPlTslMj1JxRr6T9hcQu1r8PemVO/0xHqGE5dS6frUcMF78rq7z1Kz6eyTt8TobkMQBjf8CPHPckAzfto7WUDBECp3iWI2cdOj+XRVh+WEANJs1TCS38TvAsvanubU8ZqFQRAo4bIoiVJG/OxcEy5T7JyhlpdhSpEaw6WCU3g== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Mon, Jun 23, 2025 at 5:18=E2=80=AFAM Harry Yoo wr= ote: > > On Mon, Jun 23, 2025 at 07:28:21PM +0900, Byungchul Park wrote: > > On Mon, Jun 23, 2025 at 11:32:16AM +0200, David Hildenbrand wrote: > > > On 20.06.25 06:12, Byungchul Park wrote: > > > > To simplify struct page, the page pool members of struct page shoul= d be > > > > moved to other, allowing these members to be removed from struct pa= ge. > > > > > > > > Introduce a network memory descriptor to store the members, struct > > > > netmem_desc, and make it union'ed with the existing fields in struc= t > > > > net_iov, allowing to organize the fields of struct net_iov. > > > > > > It would be great adding some result from the previous discussions in > > > here, such as that the layout of "struct net_iov" can be changed beca= use > > > it is not a "struct page" overlay, what the next steps based on this > > > > I think the network folks already know how to use and interpret their > > data struct, struct net_iov for sure.. but I will add the comment if it > > you think is needed. Thanks for the comment. > > I agree with David - it's not immediately obvious at first glance. > That was my feedback on the previous version as well :) > > I think it'd be great to add that explanation, since this is where MM and > networking intersect. > I think a lot of people are now saying the same thing: (1) lets keep net_iov and page/netmem_desc separate, and (2) lets add comments explaining their relation so this intersection between MM and networking is not confused in the long term . For #1, concretely I would recommend removing the union inside struct net_iov? And also revert all the changes to net_iov for that matter. They are all to bring netmem_desc and net_iov closer together, but the feedback is that we should keep them separate, and I kinda agree with that. The fact that net_iov includes a netmem_desc in your patch makes readers think they're very closely related. For #2, add this comment (roughly) on top of struct net_iov? Untested with kdoc and spell checker: diff --git a/include/net/netmem.h b/include/net/netmem.h index 7a1dafa3f080..8fb2b294e5f2 100644 --- a/include/net/netmem.h +++ b/include/net/netmem.h @@ -30,6 +30,25 @@ enum net_iov_type { NET_IOV_MAX =3D ULONG_MAX }; +/* A memory descriptor representing abstract networking I/O vectors. + * + * net_iovs are allocated by networking code, and generally represent some + * abstract form of non-paged memory used by the networking stack. The siz= e + * of the chunk is PAGE_SIZE. + * + * This memory can be any form of non-struct paged memory. Examples includ= e + * imported dmabuf memory and imported io_uring memory. See net_iov_type for all + * the supported types. + * + * @type: the type of the memory. Different types of net_iovs are supporte= d. + * @pp_magic: pp field, similar to the one in struct page/struct netmem_de= sc. + * @pp: the pp this net_iov belongs to, if any. + * @owner: the net_iov_area this net_iov belongs to, if any. + * @dma_addr: the dma addrs of the net_iov. Needed for the network card to + * send/receive this net_iov. + * @pp_ref_count: the pp ref count of this net_iov, exactly the same usag= e as + * struct page/struct netmem_desc. + */ -- Thanks, Mina