# Re: \[RFC v4 18/18\] page\_pool: access -\>pp\_magic through struct netmem\_desc in page\_pool\_page\_is\_pp()

- From: Harry Yoo \<hidden\>
- Date: 2025-06-05 11:50:09 
- List: netdev
- Page: https://ratatoskr.run/netdev/2025/06/3080260
- Thread: https://ratatoskr.run/netdev/2025/06/3078623/t.md

```text
On Thu, Jun 05, 2025 at 11:56:14AM +0100, Pavel Begunkov wrote:
> On 6/4/25 03:52, Byungchul Park wrote:
> > To simplify struct page, the effort to separate its own descriptor from
> > struct page is required and the work for page pool is on going.
> > 
> > To achieve that, all the code should avoid directly accessing page pool
> > members of struct page.
> 
> Just to clarify, are we leaving the corresponding struct page fields
> for now until the final memdesc conversion is done?

Yes, that's correct.

> If so, it might be better to leave the access in page_pool_page_is_pp()
> to be "page->pp_magic", so that once removed the build fails until
> the helper is fixed up to use the page->type or so.

When we truly separate netmem from struct page, we won't have 'lru' field
in memdesc (because not all types of memory are on LRU list),
so NETMEM_DESC_ASSERT_OFFSET(lru, pp_magic) should fail.

And then page_pool_page_is_pp() should be changed to check lower bits
of memdesc pointer to identify its type.

https://kernelnewbies.org/MatthewWilcox/Memdescs/Path

-- 
Cheers,
Harry / Hyeonggon
```
