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 DA74AC7EE30 for ; Tue, 1 Jul 2025 23:45:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1C42E6B00AE; Tue, 1 Jul 2025 19:45:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1758E6B00BF; Tue, 1 Jul 2025 19:45:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0645C6B00C0; Tue, 1 Jul 2025 19:45:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id E6DE86B00AE for ; Tue, 1 Jul 2025 19:45:13 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id A19C31D7087 for ; Tue, 1 Jul 2025 23:45:13 +0000 (UTC) X-FDA: 83617329306.28.8B0D1C5 Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by imf06.hostedemail.com (Postfix) with ESMTP id 0727A180007 for ; Tue, 1 Jul 2025 23:45:11 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=m4lQxpEO; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf06.hostedemail.com: domain of kuba@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=kuba@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1751413512; 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=2gx6Koktp0kBC2YeaKcaT/W8pf1ZKnS7qreryBMNmCU=; b=0T6VRYseIDnvtKR037r3QFj2ZicPGxTNUP5DCSGDnhGME+n/8atYwf3h4vYgutAWPBKvRh 3HMA8tZ/bkkGNC43Ld3pfRYKu08sRhWdFU/vL/quXammj83CoWZAq7seWazlLw81ROM7xb 7QudYGpYcTlewgiD8/xAhZWVUPfCjE4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1751413512; a=rsa-sha256; cv=none; b=kHUwOUzOzeYIPGG8YCUvMe36oZg3UBsIuaiOx9msjfzPSlkmsJKQ+v7IzBFVT7h8UsaMte qBDBVOeJ9tPIfnysnttCJ0825MDclJzRqS/d+PqhTuTVXmm0Wi6+IBamCaMQyjUQ7MlH8E p+EnBjLAqjs7Qbf9DM9OyX2W9c6DpU8= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=m4lQxpEO; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf06.hostedemail.com: domain of kuba@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=kuba@kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id A1EFE45718; Tue, 1 Jul 2025 23:45:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74E77C4CEEB; Tue, 1 Jul 2025 23:45:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751413510; bh=Gi4HgI/fcGLhn4scOdNk/B+Txx51RJ5SF8pfQNLBedw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=m4lQxpEOa6oeH3or8pRm4zhWDl23ESs4tyFmiPZeaDetKINeN+eEk2eHLQdKKrLdl fHt3OL4c60fYb4talT9acSdKCIoQ7+d5bfrOmrJQRKdbvrDM/vzJUQePmF58cmi3cB HeEZMjE5iw3bGKUVDNjOQdjO9Cyzyt6wMpIMDj457sttmG6AzAx2+9zZxb8UbHKGzZ ltLDJYyoIDitJr4JezQ7llkVUWyLR6GMgVOE4ZyTJPPz91aCJHQpE4+ufoE4Zb51G5 nQXIl31TEEH6Y9NQHwbgi1dw0wfnhawjUF5Ls0OMryT1Ld7buBh1ycR2ZnztSPWC7+ gyDok0gSbcVuQ== Date: Tue, 1 Jul 2025 16:45:08 -0700 From: Jakub Kicinski To: Harry Yoo Cc: Byungchul Park , willy@infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel_team@skhynix.com, almasrymina@google.com, 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, david@redhat.com, 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 Subject: Re: [PATCH net-next v7 1/7] netmem: introduce struct netmem_desc mirroring struct page Message-ID: <20250701164508.0738f00f@kernel.org> In-Reply-To: References: <20250625043350.7939-1-byungchul@sk.com> <20250625043350.7939-2-byungchul@sk.com> <20250626174904.4a6125c9@kernel.org> <20250627035405.GA4276@system.software.com> <20250627173730.15b25a8c@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Stat-Signature: qa45igpdohrgiwakdtxornbk45mkgqje X-Rspamd-Queue-Id: 0727A180007 X-Rspam-User: X-Rspamd-Server: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EmxxoIU4HB8JDyr3DNibA== 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, 30 Jun 2025 08:34:48 +0900 Harry Yoo wrote: > > Ugh, you keep explaining the mechanics to me. Our goal here is not > > just to move fields around and make it still compile :/ > > > > Let me ask you this way: you said "netmem_desc" will be allocated > > thru slab "shortly". How will calling the equivalent of page_address() > > on netmem_desc work at that stage? Feel free to refer me to the existing > > docs if its covered.. > > https://kernelnewbies.org/MatthewWilcox/Memdescs/Path > https://kernelnewbies.org/MatthewWilcox/Memdescs > > May not be the exact document you're looking for, > but with this article I can imagine: > > - The ultimate goal is to shrink struct page to eventually from 64 bytes > to 8 bytes, by allocating only the minimum required metadata per 4k page > statically and moving the rest of metadata to dynamically-allocated > descriptors (netmem_desc, anon, file, ptdesc, zpdesc, etc.) using slab > at page allocation time. > > - We can't achieve that goal just yet, because several subsystems > still use struct page fields for their own purposes. > > To achieve that, each of these subsystems needs to define > its own descriptor, which, for now, overlays struct page, and should be > converted to use the new descriptor. > > Eventually, these descriptors will be allocated using slab. > > - For CPU-readable buffers, page->memdesc will point to a netmem_desc, > with a lower bit set indicating that it's a netmem_desc rather than > other type. Networking code will need to cast it to (netmem_desc *) > and dereference it to access networking specific fields. > > - The struct page array (vmemmap) will still be statically allocated > at boot time (or during memory hotplug time). > So no change in how page_address() works. > > net_iovs will continue to be not associated with struct pages, > as the buffers don't have corresponding struct pages. > net_iovs are already allocated using slab. Thanks a lot, this clarifies things for me. Unfortunately, I still think that it's hard to judge patches 1 and 7 in context limited to this series, so let's proceed to reposting just the "middle 5" patches.