Thread (49 messages) flat view 49 messages, 4 authors, 2025-07-28

Re: [PATCH net-next v9 3/8] page_pool: access ->pp_magic through struct netmem_desc in page_pool_page_is_pp()

From: Pavel Begunkov <asml.silence@gmail.com>
Date: 2025-07-15 09:51:58
Also in: bpf, linux-mm, linux-rdma, lkml

On 7/14/25 20:09, Mina Almasry wrote:
On Thu, Jul 10, 2025 at 6:14 PM Byungchul Park [off-list ref] wrote:
...>> Both the mainline code and this patch can make sense *only if* it's
quoted
actually a pp page.  It's unevitable until mm provides a way to identify
the type of page for page pool.  Thoughts?
I don't see mainline having a problem. Mainline checks that the page
is a pp page via the magic before using any of the pp fields. This is
because a page* can be a pp page or a non-pp page.

With netmem_desc, having a netmem_desc* should imply that the
underlying memory is a pp page. Having a netmem_desc* that is not
valid because the pp_magic is not correct complicates the code for no
reason. Every user of netmem_desc has to check pp_magic before
actually using the fields. page_to_nmdesc should just refuse to return
a netmem_desc* if the page is not a pp page.

Also, this patch has my Reviewed-by, even though I honestly don't see
it as acceptable and I clearly have feedback (and Pavel seems too?).
I was fine with it as a transitory solution, but there is nothing
to argue about anymore since mm already got a nice way to type
check pages and we can use that.
  > __please__, when you make significant changes to a patch, you have to
reset the Reviewed-by tags.
-- 
Pavel Begunkov
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help