[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aHTQrso2Klvcwasf@hyeyoo>
Date: Mon, 14 Jul 2025 18:42:30 +0900
From: Harry Yoo <harry.yoo@...cle.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Byungchul Park <byungchul@...com>, willy@...radead.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, kernel_team@...ynix.com, almasrymina@...gle.com,
ilias.apalodimas@...aro.org, hawk@...nel.org,
akpm@...ux-foundation.org, davem@...emloft.net,
john.fastabend@...il.com, andrew+netdev@...n.ch,
asml.silence@...il.com, toke@...hat.com, tariqt@...dia.com,
edumazet@...gle.com, pabeni@...hat.com, saeedm@...dia.com,
leon@...nel.org, ast@...nel.org, daniel@...earbox.net,
david@...hat.com, lorenzo.stoakes@...cle.com, Liam.Howlett@...cle.com,
vbabka@...e.cz, rppt@...nel.org, surenb@...gle.com, mhocko@...e.com,
horms@...nel.org, linux-rdma@...r.kernel.org, bpf@...r.kernel.org,
vishal.moola@...il.com, hannes@...xchg.org, ziy@...dia.com,
jackmanb@...gle.com
Subject: Re: [PATCH net-next v7 1/7] netmem: introduce struct netmem_desc
mirroring struct page
On Tue, Jul 01, 2025 at 04:45:08PM -0700, Jakub Kicinski wrote:
> 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.
You're welcome :)
> 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.
Could you please share your thoughts on why it's hard to judge them and
what's missing from the series, such as in the comments, changelog, or
the cover letter?
--
Cheers,
Harry / Hyeonggon
Powered by blists - more mailing lists