Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH bpf-next v5 0/2] bpftool: Batch bounded hash map dumps
@ 2026-09-24 16:34 Tianyi Chen
  2026-09-24 16:34 ` [PATCH bpf-next v5 1/2] bpftool: Use batch lookups for " Tianyi Chen
  2026-09-24 16:34 ` [PATCH bpf-next v5 2/2] selftests/bpf: Check bpftool batch map dump contents Tianyi Chen
  0 siblings, 2 replies; 5+ messages in thread
From: Tianyi Chen @ 2026-09-24 16:34 UTC (permalink / raw)
  To: bpf; +Cc: qmo, andrii, eddyz87, ihor.solodrai, linux-kselftest

Use lookup batches for ordinary hash maps whose maximum key/value
storage fits within 4 MiB, preserving output and conservative fallback.

Changes in v5, addressing Quentin's review:
- Rebase onto current bpf-next and preserve the updated per-CPU printing
  interfaces. Eligibility, batching and fallback logic are unchanged.
- Replace the old performance paragraph in patch 1 with fresh matched-base
  measurements redirecting stdout to /dev/null. Median elapsed time falls
  by 37.7% for plain output and 41.2% for JSON in this fixture; separately
  measured BPF syscall counts remain 200,004 versus 395.
- The selftest patch is unchanged.

Validation:
- Built baseline and patched bpftool from the same base with GCC 16.2.1.
- All 11 bpftool_map_batch subtests pass in an x86-64 KVM guest.
- The 100,000-entry fixture produces byte-identical baseline/patched JSON.
  Plain and JSON per-CPU fallback output also matches the baseline.
- bpftool synchronization and diff checks pass.

The performance test uses Linux 7.2.5, 4-byte keys/values, one pinned vCPU,
two warm-ups and 15 alternating untraced runs per binary and output mode.
Patch 1 includes timings and methodology. This rerun uses a different
base and guest environment from the old measurement, so the change in
speedup is not attributed solely to output redirection.

v4: https://lore.kernel.org/r/20260911034732.219752-1-diannaaav@gmail.com
Review: https://lore.kernel.org/r/141264c9-2d05-4c05-a76a-306818e854ba@kernel.org

Tianyi Chen (2):
  bpftool: Use batch lookups for bounded hash map dumps
  selftests/bpf: Check bpftool batch map dump contents

 tools/bpf/bpftool/map.c                       | 117 ++++++++++-
 .../bpf/prog_tests/bpftool_map_batch.c        | 187 ++++++++++++++++++
 2 files changed, 296 insertions(+), 8 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/bpftool_map_batch.c


base-commit: 0e4cf80d0d4893d8227ba816d0559ab778af8125
-- 
2.55.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-09-25 17:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-24 16:34 [PATCH bpf-next v5 0/2] bpftool: Batch bounded hash map dumps Tianyi Chen
2026-09-24 16:34 ` [PATCH bpf-next v5 1/2] bpftool: Use batch lookups for " Tianyi Chen
2026-09-25 17:05   ` Quentin Monnet
2026-09-25 17:46     ` Tianyi Chen
2026-09-24 16:34 ` [PATCH bpf-next v5 2/2] selftests/bpf: Check bpftool batch map dump contents Tianyi Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox