Subject: Re: [PATCH v2 05/24] page_pool: Start using netmem in allocation path.

From: Jesper Dangaard Brouer <[email-masked]>
Date: Fri, 6 Jan 2023 14:59:30 +0100

On 05/01/2023 22.46, Matthew Wilcox (Oracle) wrote:
> Convert __page_pool_alloc_page_order() and __page_pool_alloc_pages_slow()
> to use netmem internally.  This removes a couple of calls
> to compound_head() that are hidden inside put_page().
> Convert trace_page_pool_state_hold(), page_pool_dma_map() and
> page_pool_set_pp_info() to take a netmem argument.
> 
> Saves 83 bytes of text in __page_pool_alloc_page_order() and 98 in
> __page_pool_alloc_pages_slow() for a total of 181 bytes.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <[email-masked]>
> ---
>   include/trace/events/page_pool.h | 14 +++++------
>   net/core/page_pool.c             | 42 +++++++++++++++++---------------
>   2 files changed, 29 insertions(+), 27 deletions(-)

Acked-by: Jesper Dangaard Brouer <[email-masked]>

Question below.

> diff --git a/net/core/page_pool.c b/net/core/page_pool.c
> index 437241aba5a7..4e985502c569 100644
> --- a/net/core/page_pool.c
> +++ b/net/core/page_pool.c
[...]
> @@ -421,7 +422,8 @@ static struct page *__page_pool_alloc_pages_slow(struct page_pool *pool,
>   		page = NULL;
>   	}
>   
> -	/* When page just alloc'ed is should/must have refcnt 1. */
> +	/* When page just allocated it should have refcnt 1 (but may have
> +	 * speculative references) */
>   	return page;

What does it mean page may have speculative references ?

And do I/we need to worry about that for page_pool?

--Jesper