linux/tools/net/ynl/samples
Jakub Kicinski 900b2801bf ynl: samples: fix recycling rate calculation
Running the page-pool sample on production machines under moderate
networking load shows recycling rate higher than 100%:

$ page-pool
    eth0[2]	page pools: 14 (zombies: 0)
		refs: 89088 bytes: 364904448 (refs: 0 bytes: 0)
		recycling: 100.3% (alloc: 1392:2290247724 recycle: 469289484:1828235386)

Note that outstanding refs (89088) == slow alloc * cache size (1392 * 64)
which means this machine is recycling page pool pages perfectly, not
a single page has been released.

The extra 0.3% is because sample ignores allocations from the ptr_ring.
Treat those the same as alloc_fast, the ring vs cache alloc is
already captured accurately enough by recycling stats.

With the fix:

$ page-pool
    eth0[2]	page pools: 14 (zombies: 0)
		refs: 89088 bytes: 364904448 (refs: 0 bytes: 0)
		recycling: 100.0% (alloc: 1392:2331141604 recycle: 473625579:1857460661)

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-03-11 10:22:06 +00:00
..
.gitignore tools: ynl: generate code for ovs families 2024-02-02 21:16:38 -08:00
devlink.c
ethtool.c tools: ynl: add sample for ethtool 2023-06-12 11:01:03 +01:00
Makefile tools: ynl: add distclean to .PHONY in all makefiles 2024-03-06 12:05:10 +00:00
netdev.c tools: ynl: Print xsk-features from the sample 2023-11-29 14:59:40 -08:00
ovs.c tools: ynl: generate code for ovs families 2024-02-02 21:16:38 -08:00
page-pool.c ynl: samples: fix recycling rate calculation 2024-03-11 10:22:06 +00:00