Re: [RFC 19/19] mm, netmem: remove the page pool members in struct page

From: Matthew Wilcox
Date: Fri May 09 2025 - 15:48:55 EST


On Fri, May 09, 2025 at 12:04:37PM -0700, Mina Almasry wrote:
> Right, all I'm saying is that if it's at all possible to keep net_iov
> something that can be extended with fields unrelated to struct page,
> lets do that. net_iov already has fields that should not belong in
> struct page like net_iov_owner and I think more will be added.

Sure, that's fine.

> I'm thinking netmem_desc can be the fields that are shared between
> struct net_iov and struct page (but both can have more specific to the
> different memory types). As you say, for now netmem_desc can currently
> overlap fields in struct page and struct net_iov, and a follow up
> change can replace it with something that gets kmalloced and (I
> guess?) there is a pointer in struct page or struct net_iov that
> refers to the netmem_desc that contains the shared fields.

I'm sure I've pointed you at
https://kernelnewbies.org/MatthewWilcox/Memdescs before.

But I wouldn't expect to have net_iov contain a pointer to netmem_desc,
rather it would embed a netmem_desc. Unless there's a good reason to
separate them.

Actually, I'd hope to do away with net_iov entirely. Networking should
handle memory-on-PCI-devices the same way everybody else does (as
hotplugged memory) rather than with its own special structures.