[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250527013116.GA37906@system.software.com>
Date: Tue, 27 May 2025 10:31:16 +0900
From: Byungchul Park <byungchul@...com>
To: Pavel Begunkov <asml.silence@...il.com>
Cc: Mina Almasry <almasrymina@...gle.com>, willy@...radead.org,
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, davem@...emloft.net,
john.fastabend@...il.com, andrew+netdev@...n.ch, 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
Subject: Re: [PATCH 18/18] mm, netmem: remove the page pool members in struct
page
On Tue, May 27, 2025 at 10:02:26AM +0900, Byungchul Park wrote:
> On Mon, May 26, 2025 at 05:58:10PM +0100, Pavel Begunkov wrote:
> > struct net_iov {
> > unsigned long flags_padding;
> > union {
> > struct {
> > // same layout as in page + build asserts;
> > ...
> > struct page_pool *pp;
> > ...
> > };
> > struct netmem_desc desc;
> > };
> > };
> >
> > struct netmem_desc *page_to_netmem_desc(struct page *page)
> > {
> > return &page->netmem_desc;
>
> page will not have any netmem things in it after this, that matters.
^
this patch series
Byungchul
>
> > }
> >
> > struct netmem_desc *netmem_to_desc(netmem_t netmem)
> > {
> > if (netmem_is_page(netmem))
> > return page_to_netmem_desc(netmem_to_page(netmem);
> > return &netmem_to_niov(netmem)->desc;
> > }
> >
> > The compiler should be able to optimise the branch in netmem_to_desc(),
> > but we might need to help it a bit.
> >
> >
> > Then, patch 2 ... N convert page pool and everyone else accessing
> > those page fields directly to netmem_to_desc / etc.
> >
> > And the final patch replaces the struct group in the page with a
> > new field:
> >
> > struct netmem_desc {
> > struct page_pool *pp;
> > ...
> > };
> >
> > struct page {
> > unsigned long flags_padding;
> > union {
> > struct netmem_desc desc;
> ^
> should be gone.
>
> Byungchul
> > ...
> > };
> > };
> >
> > net_iov will drop its union in a later series to avoid conflicts.
> >
> > btw, I don't think you need to convert page pool to netmem for this
> > to happen, so that can be done in a separate unrelated series. It's
> > 18 patches, and netdev usually requires it to be no more than 15.
> >
> > --
> > Pavel Begunkov
Powered by blists - more mailing lists