On 01 Mar 14:10, Joe Damato wrote:
Add per-cpu stats tracking page pool recycling events:
- cached: recycling placed page in the page pool cache
- cache_full: page pool cache was full
- ring: page placed into the ptr ring
- ring_full: page released from page pool because the ptr ring was full
- released_refcnt: page released (and not recycled) because refcnt > 1
Kernel documentation.
[...]
@@ -410,6 +423,11 @@ static bool page_pool_recycle_in_ring(struct page_pool *pool, struct page *page)
else
ret = ptr_ring_produce_bh(&pool->ring, page);
+#ifdef CONFIG_PAGE_POOL_STATS
+ if (ret == 0)
+ recycle_stat_inc(pool, ring);
+#endif
+
return (ret == 0) ? true : false;
}
To avoid the ifdef, it makes more sense to refactor to:
if (!ret) {
recycle_stat_inc(pool, ring);
return true;
}
return false;