Skip to content

bpf, x86: Add jit dry run mode

Jiri Olsa bpf 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 3 repliesIn review
  2. v13 patches 1 replySuperseded

Changes in v2 from the cover letter

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

[1] https://lore.kernel.org/bpf/[email protected]/
---
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

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3bpf, x86: Split x86_call_depth_emit_accounting in two functionsarch/x86/include/asm/alternative.h arch/x86/include/asm/text-patching.h arch/x86/kernel/alternative.c +2 more+21 -140 replies
2/3bpf, x86: Introduce JIT emission contextarch/x86/net/bpf_jit_comp.c+353 -4760 replies
3/3bpf, x86: Add support for jit dry runarch/x86/net/bpf_jit_comp.c+20 -223 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCHv2 bpf-next 0/3] bpf, x86: Add jit dry run mode

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/[email protected]/
---
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(-)