Page MenuHomeFreeBSD

Revise FIB lookups per second benchmarking routines
ClosedPublic

Authored by zec on May 3 2021, 10:16 PM.

Details

Summary

Add a LPS benchmark variant which introduces artificial dependencies between successive lookups. While here, instead of writing the results from the lookups to a huge array, add them to an accumulator, in a more lightweight attempt at preventing the CPU's OOO machinery from discarding the lookup results if they would be completely unused.

net.route.test.run_lps_rnd measures LPS throughput with independent uniformly random keys

net.route.test.run_lps_seq measures LPS throughput with uniformly random keys with artificial dependencies

Diff Detail

Repository
rG FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

zec requested review of this revision.May 3 2021, 10:16 PM
zec created this revision.
melifaro added inline comments.
sys/tests/fib_lookup/fib_lookup.c
526–527

We're in the sysctl handler, so M_WAITOK can be used instead.

This revision is now accepted and ready to land.May 4 2021, 8:50 AM
zec marked an inline comment as done.May 4 2021, 10:24 AM
zec added inline comments.
sys/tests/fib_lookup/fib_lookup.c
526–527

With M_WAITOK, if the user specifies too big an array, malloc may get stalled forever (bumped into this, easy to test), that's why it's better fail in such cases with M_NOWAIT.

zec marked an inline comment as done.

Simplify injection of artificial dependencies between successive lookups in an attempt to fool / defeat apparently nifty and mighty Ryzen's value predictors.

This revision now requires review to proceed.May 4 2021, 1:42 PM
melifaro added inline comments.
sys/tests/fib_lookup/fib_lookup.c
526–527

Well, maybe it's worth specifying an upper limit for a count value instead :-)
Anyway, given it's a test module, it's certainly not a big deal.

538

Nit: probably worth dropping a comment line w.r.t Ryzen

This revision is now accepted and ready to land.May 4 2021, 9:22 PM