All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/3] bpf: Speed up loads with entries
@ 2026-12-03  1:27 Alexei Starovoitov
  2026-12-03  1:27 ` [PATCH bpf-next 1/3] bpf: Limit the passes of an entry to the functions that it calls Alexei Starovoitov
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Alexei Starovoitov @ 2026-12-03  1:27 UTC (permalink / raw)
  To: bpf; +Cc: daniel, andrii, eddyz87, memxor

From: Alexei Starovoitov <ast@kernel.org>

Follow-up to "bpf: Share subprogs between programs".

The time of a load with entries grows with the number of main programs
times the size of all code. Patch 1 cuts the work that each main program
does over code that it doesn't get to. Patch 2 checks global functions
once for struct_ops, kprobes and tracepoints too.

64 tc programs, 5K insns each, that call one common function:

  copies 0.42 s, shared 3.26 s -> 0.52 s

32 kprobe programs that call the same 65 global functions:

  copies 1.12 s, shared 0.71 s -> 0.10 s, verified insns 922751 -> 28990

Verified insns of scx_lavd 54574 -> 46541, scx_rusty 12697 -> 8703.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>

Alexei Starovoitov (3):
  bpf: Limit the passes of an entry to the functions that it calls
  bpf: Check a global function once for all entries
  selftests/bpf: Test global functions that are checked once

 Documentation/bpf/verifier.rst                |  20 ++-
 include/linux/bpf_verifier.h                  |   9 ++
 kernel/bpf/fixups.c                           |   5 +-
 kernel/bpf/flow.c                             |  25 ++--
 kernel/bpf/pads.c                             |  34 +++--
 kernel/bpf/precision.c                        |  16 +--
 kernel/bpf/verifier.c                         | 119 ++++++++++++++----
 .../selftests/bpf/prog_tests/share_subprogs.c |  32 ++++-
 .../selftests/bpf/progs/share_subprogs.c      |  68 ++++++++++
 9 files changed, 258 insertions(+), 70 deletions(-)


base-commit: 147acc591553f6b9b64d7d895e32332782e2a798
-- 
2.55.0


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

end of thread, other threads:[~2026-12-03  5:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03  1:27 [PATCH bpf-next 0/3] bpf: Speed up loads with entries Alexei Starovoitov
2026-12-03  1:27 ` [PATCH bpf-next 1/3] bpf: Limit the passes of an entry to the functions that it calls Alexei Starovoitov
2026-12-03  1:27 ` [PATCH bpf-next 2/3] bpf: Check a global function once for all entries Alexei Starovoitov
2026-12-03  1:27 ` [PATCH bpf-next 3/3] selftests/bpf: Test global functions that are checked once Alexei Starovoitov
2026-12-03  2:06   ` bot+bpf-ci
2026-12-03  5:30 ` [PATCH bpf-next 0/3] bpf: Speed up loads with entries patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.