Re: [RFC v4 18/18] page_pool: access ->pp_magic through struct netmem_desc in page_pool_page_is_pp()

From
Pavel Begunkov <asml.silence@gmail.com>
Date
2025-06-05 20:14:52
Also in
bpf, linux-mm, linux-rdma, lkml
Reply to
Mina Almasry, 2025-06-05
On 6/5/25 20:47, Mina Almasry wrote:
On Thu, Jun 5, 2025 at 4:49 AM Harry Yoo [off-list ref] wrote:
quoted
On Thu, Jun 05, 2025 at 11:56:14AM +0100, Pavel Begunkov wrote:
quoted
On 6/4/25 03:52, Byungchul Park wrote:
quoted
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.
quoted
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.
Oh boy, I'm not sure that works. We already do LSB tricks with
netmem_ref to tell what kind of ref it is. I think the LSB pointer
tricks with netmem_ref and netmem_desc may trample each other's toes.
I guess we'll cross that bridge when we get to it...
I believe Harry wants to tag struct page::memdesc, while
netmem is tagging the struct page pointer / net_iov.

-- 
Pavel Begunkov
Thread (65 messages) 65 messages, 6 authors, last reply 2025-06-09
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help