linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Byungchul Park <byungchul@sk.com>
To: "Toke Høiland-Jørgensen" <toke@redhat.com>
Cc: willy@infradead.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	kernel_team@skhynix.com, kuba@kernel.org, almasrymina@google.com,
	ilias.apalodimas@linaro.org, harry.yoo@oracle.com,
	hawk@kernel.org, akpm@linux-foundation.org, ast@kernel.org,
	daniel@iogearbox.net, davem@davemloft.net,
	john.fastabend@gmail.com, andrew+netdev@lunn.ch,
	edumazet@google.com, pabeni@redhat.com, vishal.moola@gmail.com
Subject: Re: [RFC 13/19] page_pool: expand scope of is_pp_{netmem,page}() to global
Date: Mon, 12 May 2025 21:55:06 +0900	[thread overview]
Message-ID: <20250512125506.GD45370@system.software.com> (raw)
In-Reply-To: <87y0v22dzn.fsf@toke.dk>

On Mon, May 12, 2025 at 02:46:36PM +0200, Toke Høiland-Jørgensen wrote:
> Byungchul Park <byungchul@sk.com> writes:
> 
> > Other than skbuff.c might need to check if a page or netmem is for page
> > pool, for example, page_alloc.c needs to check the page state, whether
> > it comes from page pool or not for their own purpose.
> >
> > Expand the scope of is_pp_netmem() and introduce is_pp_page() newly, so
> > that those who want to check the source can achieve the checking without
> > accessing page pool member, page->pp_magic, directly.
> >
> > Signed-off-by: Byungchul Park <byungchul@sk.com>
> > ---
> >  include/net/page_pool/types.h |  2 ++
> >  net/core/page_pool.c          | 10 ++++++++++
> >  net/core/skbuff.c             |  5 -----
> >  3 files changed, 12 insertions(+), 5 deletions(-)
> >
> > diff --git a/include/net/page_pool/types.h b/include/net/page_pool/types.h
> > index 36eb57d73abc6..d3e1a52f01e09 100644
> > --- a/include/net/page_pool/types.h
> > +++ b/include/net/page_pool/types.h
> > @@ -299,4 +299,6 @@ static inline bool is_page_pool_compiled_in(void)
> >  /* Caller must provide appropriate safe context, e.g. NAPI. */
> >  void page_pool_update_nid(struct page_pool *pool, int new_nid);
> >  
> > +bool is_pp_netmem(netmem_ref netmem);
> > +bool is_pp_page(struct page *page);
> >  #endif /* _NET_PAGE_POOL_H */
> > diff --git a/net/core/page_pool.c b/net/core/page_pool.c
> > index b61c1038f4c68..9c553e5a1b555 100644
> > --- a/net/core/page_pool.c
> > +++ b/net/core/page_pool.c
> > @@ -1225,3 +1225,13 @@ void net_mp_niov_clear_page_pool(struct netmem_desc *niov)
> >  
> >  	page_pool_clear_pp_info(netmem);
> >  }
> > +
> > +bool is_pp_netmem(netmem_ref netmem)
> > +{
> > +	return (netmem_get_pp_magic(netmem) & ~0x3UL) == PP_SIGNATURE;
> > +}
> > +
> > +bool is_pp_page(struct page *page)
> > +{
> > +	return is_pp_netmem(page_to_netmem(page));
> > +}
> > diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> > index 6cbf77bc61fce..11098c204fe3e 100644
> > --- a/net/core/skbuff.c
> > +++ b/net/core/skbuff.c
> > @@ -893,11 +893,6 @@ static void skb_clone_fraglist(struct sk_buff *skb)
> >  		skb_get(list);
> >  }
> >  
> > -static bool is_pp_netmem(netmem_ref netmem)
> > -{
> > -	return (netmem_get_pp_magic(netmem) & ~0x3UL) == PP_SIGNATURE;
> > -}
> > -
> 
> This has already been moved to mm.h (and the check changed) by commit:
> 
> cd3c93167da0 ("page_pool: Move pp_magic check into helper functions")
> 
> You should definitely rebase this series on top of that (and the
> subsequent ee62ce7a1d90 ("page_pool: Track DMA-mapped pages and unmap
> them when destroying the pool")), as these change the semantics of how
> page_pool interacts with struct page.
> 
> Both of these are in net-next, which Mina already asked you to rebase
> on, so I guess you'll pick it up there, put flagging it here just for
> completeness :)

I will not miss it.  Thanks.

	Byungchul
> 
> -Toke
> 


  reply	other threads:[~2025-05-12 12:55 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-09 11:51 [RFC 00/19] Split netmem from struct page Byungchul Park
2025-05-09 11:51 ` [RFC 01/19] netmem: rename struct net_iov to struct netmem_desc Byungchul Park
2025-05-12 13:11   ` Pavel Begunkov
2025-05-12 13:29     ` Byungchul Park
2025-05-12 19:14       ` Mina Almasry
2025-05-13  2:00         ` Byungchul Park
2025-05-13 12:58           ` Pavel Begunkov
2025-05-13 12:49       ` Pavel Begunkov
2025-05-14  0:07         ` Byungchul Park
2025-05-09 11:51 ` [RFC 02/19] netmem: introduce netmem alloc/put API to wrap page alloc/put API Byungchul Park
2025-05-09 13:39   ` Mina Almasry
2025-05-09 14:08     ` Mina Almasry
2025-05-12 12:30       ` Byungchul Park
2025-05-09 11:51 ` [RFC 03/19] page_pool: use netmem alloc/put API in __page_pool_alloc_page_order() Byungchul Park
2025-05-09 11:51 ` [RFC 04/19] page_pool: rename __page_pool_alloc_page_order() to __page_pool_alloc_large_netmem() Byungchul Park
2025-05-09 11:51 ` [RFC 05/19] page_pool: use netmem alloc/put API in __page_pool_alloc_pages_slow() Byungchul Park
2025-05-09 11:51 ` [RFC 06/19] page_pool: rename page_pool_return_page() to page_pool_return_netmem() Byungchul Park
2025-05-09 11:51 ` [RFC 07/19] page_pool: use netmem alloc/put API in page_pool_return_netmem() Byungchul Park
2025-05-09 11:51 ` [RFC 08/19] page_pool: rename __page_pool_release_page_dma() to __page_pool_release_netmem_dma() Byungchul Park
2025-05-09 11:51 ` [RFC 09/19] page_pool: rename __page_pool_put_page() to __page_pool_put_netmem() Byungchul Park
2025-05-09 11:51 ` [RFC 10/19] page_pool: rename __page_pool_alloc_pages_slow() to __page_pool_alloc_netmems_slow() Byungchul Park
2025-05-09 11:51 ` [RFC 11/19] mlx4: use netmem descriptor and API for page pool Byungchul Park
2025-05-09 11:51 ` [RFC 12/19] netmem: introduce page_pool_recycle_direct_netmem() Byungchul Park
2025-05-09 11:51 ` [RFC 13/19] page_pool: expand scope of is_pp_{netmem,page}() to global Byungchul Park
2025-05-12 12:46   ` Toke Høiland-Jørgensen
2025-05-12 12:55     ` Byungchul Park [this message]
2025-05-14  3:00     ` Byungchul Park
2025-05-14 11:17       ` Toke Høiland-Jørgensen
2025-05-09 11:51 ` [RFC 14/19] mm: page_alloc: do not directly access page->pp_magic but use is_pp_page() Byungchul Park
2025-05-09 11:51 ` [RFC 15/19] mlx5: use netmem descriptor and API for page pool Byungchul Park
2025-05-09 11:51 ` [RFC 16/19] netmem: use _Generic to cover const casting for page_to_netmem() Byungchul Park
2025-05-09 11:51 ` [RFC 17/19] netmem: remove __netmem_get_pp() Byungchul Park
2025-05-09 13:47   ` Mina Almasry
2025-05-09 11:51 ` [RFC 18/19] page_pool: make page_pool_get_dma_addr() just wrap page_pool_get_dma_addr_netmem() Byungchul Park
2025-05-09 13:49   ` Mina Almasry
2025-05-10  7:28   ` Ilias Apalodimas
2025-05-09 11:51 ` [RFC 19/19] mm, netmem: remove the page pool members in struct page Byungchul Park
2025-05-09 17:32   ` Mina Almasry
2025-05-09 18:11     ` Matthew Wilcox
2025-05-09 19:04       ` Mina Almasry
2025-05-09 19:48         ` Matthew Wilcox
2025-05-12 19:10           ` Mina Almasry
2025-05-09 18:02   ` Matthew Wilcox
2025-05-12 12:51     ` Byungchul Park
2025-05-12 14:42       ` Matthew Wilcox
2025-05-13  1:42         ` Byungchul Park
2025-05-13  3:19           ` Matthew Wilcox
2025-05-13 10:24             ` Byungchul Park
2025-05-10  7:26   ` Ilias Apalodimas
2025-05-12 12:58     ` Byungchul Park
2025-05-09 14:09 ` [RFC 00/19] Split netmem from " Mina Almasry
2025-05-12 12:36   ` Byungchul Park
2025-05-12 12:59     ` Pavel Begunkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250512125506.GD45370@system.software.com \
    --to=byungchul@sk.com \
    --cc=akpm@linux-foundation.org \
    --cc=almasrymina@google.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=harry.yoo@oracle.com \
    --cc=hawk@kernel.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=john.fastabend@gmail.com \
    --cc=kernel_team@skhynix.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=toke@redhat.com \
    --cc=vishal.moola@gmail.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox