Subject: Re: [PATCH RFC v4 1/3] page_pool: fix timing for checking and disabling napi_local

From: Jakub Kicinski <[email-masked]>
Date: Wed, 4 Dec 2024 17:28:46 -0800

On Wed, 4 Dec 2024 19:01:14 +0800 Yunsheng Lin wrote:
> > I don't think this is in the right place.
> > Why not inside page_pool_disable_direct_recycling() ?  
> 
> It is in page_pool_destroy() mostly because:
> 1. Only call synchronize_rcu() when there is inflight pages, which should
>    be an unlikely case, and  synchronize_rcu() might need to be called at
>    least for the case of pool->p.napi not being NULL if it is called inside
>    page_pool_disable_direct_recycling().

Right, my point was that page_pool_disable_direct_recycling() 
is an exported function, its callers also need to be protected.