linux/tools/testing/selftests/bpf/benchs
Dave Marchevsky 2b4b2621fd selftests/bpf: Add benchmark for local_storage RCU Tasks Trace usage
This benchmark measures grace period latency and kthread cpu usage of
RCU Tasks Trace when many processes are creating/deleting BPF
local_storage. Intent here is to quantify improvement on these metrics
after Paul's recent RCU Tasks patches [0].

Specifically, fork 15k tasks which call a bpf prog that creates/destroys
task local_storage and sleep in a loop, resulting in many
call_rcu_tasks_trace calls.

To determine grace period latency, trace time elapsed between
rcu_tasks_trace_pregp_step and rcu_tasks_trace_postgp; for cpu usage
look at rcu_task_trace_kthread's stime in /proc/PID/stat.

On my virtualized test environment (Skylake, 8 cpus) benchmark results
demonstrate significant improvement:

BEFORE Paul's patches:

  SUMMARY tasks_trace grace period latency        avg 22298.551 us stddev 1302.165 us
  SUMMARY ticks per tasks_trace grace period      avg 2.291 stddev 0.324

AFTER Paul's patches:

  SUMMARY tasks_trace grace period latency        avg 16969.197 us  stddev 2525.053 us
  SUMMARY ticks per tasks_trace grace period      avg 1.146 stddev 0.178

Note that since these patches are not in bpf-next benchmarking was done
by cherry-picking this patch onto rcu tree.

  [0] https://lore.kernel.org/rcu/20220620225402.GA3842369@paulmck-ThinkPad-P17-Gen-1/

Signed-off-by: Dave Marchevsky <davemarchevsky@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Paul E. McKenney <paulmck@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20220705190018.3239050-1-davemarchevsky@fb.com
2022-07-07 16:35:21 +02:00
..
bench_bloom_filter_map.c selftests/bpf: Fix a tautological-constant-out-of-range-compare compiler warning 2021-11-12 14:11:46 -08:00
bench_bpf_hashmap_full_update.c selftest/bpf/benchs: Add bpf_map benchmark 2022-06-11 14:25:35 -07:00
bench_bpf_loop.c selftest/bpf/benchs: Add bpf_loop benchmark 2021-11-30 10:56:28 -08:00
bench_count.c selftests/bpf: Fix checkpatch error on empty function parameter 2021-12-11 17:40:23 -08:00
bench_local_storage_rcu_tasks_trace.c selftests/bpf: Add benchmark for local_storage RCU Tasks Trace usage 2022-07-07 16:35:21 +02:00
bench_local_storage.c selftests/bpf: Add benchmark for local_storage get 2022-06-22 19:14:33 -07:00
bench_rename.c selftests/bpf: Fix checkpatch error on empty function parameter 2021-12-11 17:40:23 -08:00
bench_ringbufs.c selftests/bpf: use preferred setter/getter APIs instead of deprecated ones 2022-01-25 17:59:07 -08:00
bench_strncmp.c selftests/bpf: Add benchmark for bpf_strncmp() helper 2021-12-11 17:40:23 -08:00
bench_trigger.c selftests/bpf: fix uprobe offset calculation in selftests 2022-01-26 20:04:01 -08:00
run_bench_bloom_filter_map.sh bpf/benchs: Add benchmarks for comparing hashmap lookups w/ vs. w/out bloom filter 2021-10-28 13:22:49 -07:00
run_bench_bpf_hashmap_full_update.sh selftest/bpf/benchs: Add bpf_map benchmark 2022-06-11 14:25:35 -07:00
run_bench_bpf_loop.sh selftest/bpf/benchs: Add bpf_loop benchmark 2021-11-30 10:56:28 -08:00
run_bench_local_storage_rcu_tasks_trace.sh selftests/bpf: Add benchmark for local_storage RCU Tasks Trace usage 2022-07-07 16:35:21 +02:00
run_bench_local_storage.sh selftests/bpf: Add benchmark for local_storage get 2022-06-22 19:14:33 -07:00
run_bench_rename.sh
run_bench_ringbufs.sh bpf/benchs: Add benchmark tests for bloom filter throughput + false positive 2021-10-28 13:22:49 -07:00
run_bench_strncmp.sh selftests/bpf: Add benchmark for bpf_strncmp() helper 2021-12-11 17:40:23 -08:00
run_bench_trigger.sh selftest/bpf: Add BPF triggering benchmark 2020-05-13 12:19:38 -07:00
run_common.sh selftests/bpf: Add benchmark for local_storage get 2022-06-22 19:14:33 -07:00