Skip to contentSkip to conversation

page_pool: check for dma_sync_size earlier

PATCH Superseded Furong Xu 2 participants 2 messages Jan 3, 2025 – Jan 4, 2025

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Furong Xu

author
#0 lore raw

PATCH v2 1/1 page_pool: check for dma_sync_size earlier

Setting dma_sync_size to 0 is not illegal, fec_main.c and ravb_main.c already did.
We can save a couple of function calls if check for dma_sync_size earlier.

This is a micro optimization, about 0.6% overall performance improvement has been observed on a Cortex-A53 platform.

---
V1 -> V2: Add measurement data about performance improvement in commit message
V1: https://lore.kernel.org/r/[email protected]

---
 net/core/page_pool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/page_pool.c +1 -1
index 9733206d6406..9bb2d2300d0b 100644
@@ -458,7 +458,7 @@ page_pool_dma_sync_for_device(const struct page_pool *pool,
 			      netmem_ref netmem,
 			      u32 dma_sync_size)
 {
-	if (pool->dma_sync && dma_dev_need_sync(pool->p.dev))
+	if (pool->dma_sync && dma_dev_need_sync(pool->p.dev) && dma_sync_size)
 		__page_pool_dma_sync_for_device(pool, netmem, dma_sync_size);
 }
 
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 2 lines · On Fri, 3 Jan 2025 16:28:14 +0800 Furong Xu wrote:

This is a micro optimization, about 0.6% overall performance improvement has been observed on a Cortex-A53 platform.

You need to say more about how you measured this improvement. Is it PPS improvement in a traffic test?
Measured using a micro-benchmark?
Based on first order metric or by comparing perf output?

Signature · 1 line
pw-bot: cr