BPF List
 help / color / mirror / Atom feed
* [PATCHv2 bpf-next 0/3] bpf, x86: Add jit dry run mode
@ 2026-09-03  9:20 Jiri Olsa
  2026-09-03  9:20 ` [PATCHv2 bpf-next 1/3] bpf, x86: Split x86_call_depth_emit_accounting in two functions Jiri Olsa
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Jiri Olsa @ 2026-09-03  9:20 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
  Cc: bpf, Martin KaFai Lau, Eduard Zingerman, Song Liu, Yonghong Song,
	Mike Rapoport

hi,
we recently hit performance issue in arch_bpf_trampoline_size,
that Mike fixed in [1].

I wondered we could go completely without emitting jit code for
getting just the trampoline size as we do on arm and it turned
out it actually makes the tracing_multi attachment benchmark
much faster.

With current code:

  # ./test_progs -t tracing_multi_bench_attach -v
  ...
  serial_test_tracing_multi_bench_attach: found 55227 functions
  serial_test_tracing_multi_bench_attach: attached in   1.563s
  serial_test_tracing_multi_bench_attach: detached in   0.256s

With the fix:

  # ./test_progs -t tracing_multi_bench_attach -v
  ...
  serial_test_tracing_multi_bench_attach: found 55235 functions
  serial_test_tracing_multi_bench_attach: attached in   0.798s
  serial_test_tracing_multi_bench_attach: detached in   0.258s

thanks,
jirka


v2 changes:
- drop out label in emit_mov_imm32, it's not needed [ci-bot]


[1] https://lore.kernel.org/bpf/20260818130510.3110054-1-rppt@kernel.org/
---
Jiri Olsa (3):
      bpf, x86: Split x86_call_depth_emit_accounting in two functions
      bpf, x86: Introduce JIT emission context
      bpf, x86: Add support for jit dry run

 arch/x86/include/asm/alternative.h   |   4 +-
 arch/x86/include/asm/text-patching.h |   2 +
 arch/x86/kernel/alternative.c        |   2 -
 arch/x86/kernel/callthunks.c         |   7 +-
 arch/x86/net/bpf_jit_comp.c          | 869 ++++++++++++++++++++++++++++++++++++++++---------------------------------------------------
 5 files changed, 383 insertions(+), 501 deletions(-)

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

end of thread, other threads:[~2026-09-04 14:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03  9:20 [PATCHv2 bpf-next 0/3] bpf, x86: Add jit dry run mode Jiri Olsa
2026-09-03  9:20 ` [PATCHv2 bpf-next 1/3] bpf, x86: Split x86_call_depth_emit_accounting in two functions Jiri Olsa
2026-09-03 10:14   ` bot+bpf-ci
2026-09-03  9:20 ` [PATCHv2 bpf-next 2/3] bpf, x86: Introduce JIT emission context Jiri Olsa
2026-09-03 10:14   ` bot+bpf-ci
2026-09-03  9:20 ` [PATCHv2 bpf-next 3/3] bpf, x86: Add support for jit dry run Jiri Olsa
2026-09-03 10:28   ` bot+bpf-ci
2026-09-04  4:40   ` Alexei Starovoitov
2026-09-04  7:45     ` Jiri Olsa
2026-09-04 14:55       ` Alexei Starovoitov

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