Re: [PATCH net-next v1] page_pool: check for dma_sync_size earlier

From: Jakub Kicinski
Date: Fri Oct 11 2024 - 11:49:34 EST


On Fri, 11 Oct 2024 17:26:05 +0800 Furong Xu wrote:
> > In order to support the above use case, it seems there might be two
> > options here:
> > 1. Driver calls page_pool_create() without PP_FLAG_DMA_SYNC_DEV and
> > handle the dma sync itself.
> > 2. Page_pool may provides a non-dma-sync version of page_pool_put_page()
> > API even when Driver calls page_pool_create() with PP_FLAG_DMA_SYNC_DEV.
> >
> > Maybe option 2 is better one in the longer term as it may provide some
> > flexibility for the user and enable removing of the DMA_SYNC_DEV in the
> > future?
>
> What is your opinion about this?

I think your patch is fine, but it's a micro optimization so you need
to provide some measurement data to show how much of a performance
improvement you're getting.