[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aB5FUKRV86Tg92b6@casper.infradead.org>
Date: Fri, 9 May 2025 19:11:28 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Mina Almasry <almasrymina@...gle.com>
Cc: Byungchul Park <byungchul@...com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
kernel_team@...ynix.com, kuba@...nel.org,
ilias.apalodimas@...aro.org, harry.yoo@...cle.com, hawk@...nel.org,
akpm@...ux-foundation.org, ast@...nel.org, daniel@...earbox.net,
davem@...emloft.net, john.fastabend@...il.com,
andrew+netdev@...n.ch, edumazet@...gle.com, pabeni@...hat.com,
vishal.moola@...il.com
Subject: Re: [RFC 19/19] mm, netmem: remove the page pool members in struct
page
On Fri, May 09, 2025 at 10:32:08AM -0700, Mina Almasry wrote:
> Currently the only restriction on net_iov is that some of its fields
> need to be cache aligned with some of the fields of struct page, but
Cache aligned? Do you mean alias (ie be at the same offset)?
> What I would suggest here is, roughly:
>
> 1. Add a new struct:
>
> struct netmem_desc {
> unsigned long pp_magic;
> struct page_pool *pp;
> unsigned long _pp_mapping_pad;
> unsigned long dma_addr;
> atomic_long_t pp_ref_count;
> };
>
> 2. Then update struct page to include this entry instead of the definitions:
>
> struct page {
> ...
> struct netmem_desc place_holder_1; /* for page pool */
> ...
> }
No, the point is to move these fields out of struct page entirely.
At some point (probably this year), we'll actually kmalloc the netmem_desc
(and shrink struct page), but for now, it'll overlap the other fields
in struct page.
> 3. And update struct net_iov to also include netmem_desc:
>
> struct net_iov {
> struct netmem_desc desc;
> struct net_iov_area *owner;
> /* More net_iov specific fields in the future */
> };
>
> And drop patch 1 which does a rename.
>
> Essentially netmem_desc can be an encapsulation of the shared fields
> between struct page and struct net_iov.
That is not the goal.
Powered by blists - more mailing lists