selftests/bpf: Add bench for task storage creation
authorMartin KaFai Lau <martin.lau@kernel.org>
Wed, 22 Mar 2023 21:52:46 +0000 (14:52 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 26 Mar 2023 02:52:52 +0000 (19:52 -0700)
commitcbe9d93d58b16b5912498ea42b5173022fff7c04
treec5ac30ad68786fa9636d46cb2dbb8d1f36fccc04
parentd8db84d71c0e539f7ce902e2fe297e535ba4d46c
selftests/bpf: Add bench for task storage creation

This patch adds a task storage benchmark to the existing
local-storage-create benchmark.

For task storage,
./bench --storage-type task --batch-size 32:
   bpf_ma: Summary: creates   30.456 ± 0.507k/s ( 30.456k/prod), 6.08 kmallocs/create
no bpf_ma: Summary: creates   31.962 ± 0.486k/s ( 31.962k/prod), 6.13 kmallocs/create

./bench --storage-type task --batch-size 64:
   bpf_ma: Summary: creates   30.197 ± 1.476k/s ( 30.197k/prod), 6.08 kmallocs/create
no bpf_ma: Summary: creates   31.103 ± 0.297k/s ( 31.103k/prod), 6.13 kmallocs/create

Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20230322215246.1675516-6-martin.lau@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/bench.c
tools/testing/selftests/bpf/benchs/bench_local_storage_create.c
tools/testing/selftests/bpf/progs/bench_local_storage_create.c