Re: [PATCH net-next v4] page_pool: import Jesper's page_pool benchmark

From: Mina Almasry
Date: Thu Jun 19 2025 - 00:20:18 EST


On Wed, Jun 18, 2025 at 5:46 AM Jesper Dangaard Brouer <hawk@xxxxxxxxxx> wrote:
> >> Something is off with benchmark numbers compared to the OOT version.
> >>
> >
> > I assume you're comparing my results (my kernel config + my hardware +
> > upstream benchmark) with your results (your kernel config + your
> > hardware + OOT version). The problem may be in OOT vs upstream but it
> > may be just different code/config/hardware.
>
> True I used OOT version.
>
> Just applied this patch, but I get compile error. Because Makefile tries
> to get kernel headers (net/page_pool/helpers.h) from local Linux
> installation instead of git tree. This need to be adjusted for patch,
> such that it builds with src-local/git tree provided headers.
>

I believe the fix to that is to do:

make KDIR=$(pwd) -C ./tools/testing/selftests/net/bench

I.e. the build files assume you're building the test to run it on the
current machine, to cross compile it for a different machine under
test, we need to pass explicit KDIR. I've kinda copy-pasted what other
TEST_GEN_MODS_DIR= makefiles do. In theory we could do something else
but I am guessing the way current TEST_GEN_MODS_DIR does it is the way
to go. Does it work for you if you do that?

[...]
> >
> > Yeah, I actually just checked and I have CONFIG_DEBUG_NET on in my
> > build, and a lot of other debug configs are turned on.
> >
>
> The CONFIG_DEBUG_NET should be low overhead, so I don't expect this to
> be the root-cause. Other CONFIG options are more likely the issue.
>

Thank you very much for the tips. Perf report showed the locking was
taking forever on my kernel... I had locking debug configs enabled in
my build... sorry... with those disabled, I get much more sane
results:

[ 185.557293] bench_page_pool: time_bench_page_pool01_fast_path():
Cannot use page_pool fast-path
[ 185.607873] bench_page_pool: Type:no-softirq-page_pool01 Per elem:
11 cycles(tsc) 4.177 ns (step:0) - (measurement period
time:0.041772642 sec time_interval:41772642) - (invoke count:10000000
tsc_interval:112778487)
[ 185.627090] bench_page_pool: time_bench_page_pool02_ptr_ring():
Cannot use page_pool fast-path
[ 185.826991] bench_page_pool: Type:no-softirq-page_pool02 Per elem:
51 cycles(tsc) 19.117 ns (step:0) - (measurement period
time:0.191178107 sec time_interval:191178107) - (invoke count:10000000
tsc_interval:516173586)
[ 185.846380] bench_page_pool: time_bench_page_pool03_slow(): Cannot
use page_pool fast-path
[ 186.479432] bench_page_pool: Type:no-softirq-page_pool03 Per elem:
168 cycles(tsc) 62.469 ns (step:0) - (measurement period
time:0.624690697 sec time_interval:624690697) - (invoke count:10000000
tsc_interval:1686656879)

Does this alleviate your concern? Or do you still see an issue here?
There is still a delta between our results, on different
hardware/configs but results are in a sane range now.

--
Thanks,
Mina