BPF List
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@kernel.org>
To: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>
Cc: bpf@vger.kernel.org, Martin KaFai Lau <martin.lau@linux.dev>,
	Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH bpf-next 0/3] bpf, x86: Add jit dry run mode
Date: Mon, 31 Aug 2026 13:46:11 +0200	[thread overview]
Message-ID: <20260831114614.157277-1-jolsa@kernel.org> (raw)

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


[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          | 864 ++++++++++++++++++++++++++++++++++++++++---------------------------------------------------
 5 files changed, 381 insertions(+), 498 deletions(-)

             reply	other threads:[~2026-08-31 11:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 11:46 Jiri Olsa [this message]
2026-08-31 11:46 ` [PATCH bpf-next 1/3] bpf, x86: Split x86_call_depth_emit_accounting in two functions Jiri Olsa
2026-08-31 11:46 ` [PATCH bpf-next 2/3] bpf, x86: Introduce JIT emission context Jiri Olsa
2026-08-31 12:54   ` bot+bpf-ci
2026-09-01  8:11     ` Jiri Olsa
2026-08-31 11:46 ` [PATCH bpf-next 3/3] bpf, x86: Add support for jit dry run Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260831114614.157277-1-jolsa@kernel.org \
    --to=jolsa@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=martin.lau@linux.dev \
    --cc=rppt@kernel.org \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox