@@ -149,6 +149,7 @@ struct page_pool_stats {
u64 empty; /* failed refills due to empty ptr ring, forcing
* slow path allocation
*/
+ u64 refill; /* allocations via successful refill */
} alloc;
};
#endif
@@ -172,8 +172,10 @@ static struct page *page_pool_refill_alloc_cache(struct page_pool *pool)
} while (pool->alloc.count < PP_ALLOC_CACHE_REFILL);
/* Return last page */
- if (likely(pool->alloc.count > 0))
+ if (likely(pool->alloc.count > 0)) {
page = pool->alloc.cache[--pool->alloc.count];
+ this_cpu_inc_alloc_stat(pool, refill);
+ }
return page;
}
Add a stat tracking succesfull allocations which triggered a refill. Signed-off-by: Joe Damato <jdamato@fastly.com> --- include/net/page_pool.h | 1 + net/core/page_pool.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-)