lkml.org 
[lkml]   [2023]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next 06/11] net: page_pool: avoid calling no-op externals when possible
On Tue, 16 May 2023 18:18:36 +0200 Alexander Lobakin wrote:
> + /* Try to avoid calling no-op syncs */
> + pool->p.flags |= PP_FLAG_DMA_MAYBE_SYNC;
> + pool->p.flags &= ~PP_FLAG_DMA_SYNC_DEV;
> }
>
> if (PAGE_POOL_DMA_USE_PP_FRAG_COUNT &&
> @@ -323,6 +327,12 @@ static bool page_pool_dma_map(struct page_pool *pool, struct page *page)
>
> page_pool_set_dma_addr(page, dma);
>
> + if ((pool->p.flags & PP_FLAG_DMA_MAYBE_SYNC) &&
> + dma_need_sync(pool->p.dev, dma)) {
> + pool->p.flags |= PP_FLAG_DMA_SYNC_DEV;
> + pool->p.flags &= ~PP_FLAG_DMA_MAYBE_SYNC;
> + }

is it just me or does it feel cleaner to allocate a page at init,
and throw it into the cache, rather than adding a condition to a
fast(ish) path?

\
 
 \ /
  Last update: 2023-05-18 06:09    [W:0.203 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site