Re: [PATCH 18/18] mm, netmem: remove the page pool members in struct page

Pavel Begunkov
2025-05-27T05:29:04Z

On 5/27/25 02:02, Byungchul Park wrote:
...>> Patch 1:
>>
>> struct page {
>> unsigned long flags;
>> union {
>> struct_group_tagged(netmem_desc, netmem_desc) {
>> // same layout as before
>> ...
>> struct page_pool *pp;
>> ...
>> };
>
> This part will be gone shortly. The matters come from absence of this
> part.

Right, the problem is not having an explicit netmem_desc in struct
page and not using struct netmem_desc in all relevant helpers.

>> 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.

Ok, the question is where are you going to stash the fields?
We still need space to store them. Are you going to do the
indirection mm folks want?

AFAIK, the plan is that in the end pages will still have
netmem_desc but through an indirection. E.g.

static inline bool page_pool_page_is_pp(struct page *page)
{
return page->page_type == PAGE_PP_NET;
}

struct netmem_desc *page_to_netmem_desc(struct page *page)
{
return page->page_private;
}

--
Pavel Begunkov