Re: [PATCH net-next v8 2/6] page_pool: unify frag_count handling in page_pool_is_last_frag()

From: Yunsheng Lin
Date: Mon Sep 18 2023 - 08:30:02 EST


On 2023/9/14 23:17, Paolo Abeni wrote:
>> --- a/net/core/page_pool.c
>> +++ b/net/core/page_pool.c
>> @@ -376,6 +376,14 @@ static void page_pool_set_pp_info(struct page_pool *pool,
>> {
>> page->pp = pool;
>> page->pp_magic |= PP_SIGNATURE;
>> +
>> + /* Ensuring all pages have been split into one big frag initially:
>> + * page_pool_set_pp_info() is only called once for every page when it
>> + * is allocated from the page allocator and page_pool_fragment_page()
>> + * is dirtying the same cache line as the page->pp_magic above, so
>> + * the overhead is negligible.
>> + */
>> + page_pool_fragment_page(page, 1);
>> if (pool->p.init_callback)
>> pool->p.init_callback(page, pool->p.init_arg);
>> }
>
> I think it would be nice backing the above claim with some benchmarks.
> (possibly even just a micro-benchmark around the relevant APIs)
> and include such info into the changelog message.

Sure, will adjust Jesper's below micro-benchmark to test it:
https://github.com/netoptimizer/prototype-kernel/blob/master/kernel/lib/bench_page_pool_simple.c

Please let me know if there is other better idea to do the
micro-benchmark in your mind, thanks.

>
> Cheers,
>
> Paolo
>
> .
>