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

Re: [PATCH] mm, page_pool: introduce a new page type for page pool in page type

From: Mina Almasry <hidden>
Date: 2025-07-22 22:20:18
Also in: bpf, linux-mm, linux-rdma, lkml

On Mon, Jul 21, 2025 at 4:11 AM Pavel Begunkov [off-list ref] wrote:
On 7/21/25 06:49, Byungchul Park wrote:
quoted
Hi,

I focused on converting the existing APIs accessing ->pp_magic field to
page type APIs.  However, yes.  Additional works would better be
considered on top like:

    1. Adjust how to store and retrieve dma index.  Maybe network guys
       can work better on top.

    2. Move the sanity check for page pool in mm/page_alloc.c to on free.
Don't be in a hurry, I've got a branch, but as mentioned before,
it'll be for-6.18. And there will also be more time for testing.
quoted
This work was inspired by the following link by Pavel:
The idea came from David, let's add

Suggested-by: David Hildenbrand <redacted>

...> -
quoted
  static inline bool netmem_is_pp(netmem_ref netmem)
  {
-     return (netmem_get_pp_magic(netmem) & PP_MAGIC_MASK) == PP_SIGNATURE;
+     if (netmem_is_net_iov(netmem))
This needs to return false for tx niovs. Seems like all callers are
gated on ->pp_recycle, so maybe it's fine, but we can at least
check pp. Mina, you've been checking tx doesn't mix with rx, any
opinion on that?

Question to net maintainers, can a ->pp_recycle marked skb contain
not page pool originated pages or a mix?
IIRC last I looked at the code ->pp_recycle technically means it could
be a mix. Technically it means "consider this netmem for pp recycling
when the skb is freed." and non-pp netmems don't get recycled to the
pp obviously, because napi_pp_put_page rejects recycling them.


-- 
Thanks,
Mina
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help