diff options
| author | Alexei Starovoitov <ast@kernel.org> | 2026-10-23 15:03:02 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2026-10-28 04:20:25 +0000 |
| commit | c8a8a68d3ab4a06c8f5a13a8c00275351c8239b4 (patch) | |
| tree | 6ae442cabe0af6698e32cb3a7deb3c8662654c04 /include/uapi/linux | |
| parent | 6c476d2b73056ed151c3f8b884c627c75999ed7c (diff) | |
| download | linux-c8a8a68d3ab4a06c8f5a13a8c00275351c8239b4.tar.gz linux-c8a8a68d3ab4a06c8f5a13a8c00275351c8239b4.zip | |
bpf: Don't re-sort subprog_info[] for every new subprogram
add_subprog() appends new subprog to env->subprog_info[] and calls sort()
on the whole array, though only the last entry can be out of order.
Move subprogs that start after the new one up by one entry instead.
'start' is unique, so the order of the array doesn't change. The new entry
can land in a used slot, so initialize all of it.
add_subprog() returns the index of the new subprog instead of the last
one. The callers check for error only.
It's a trivial prep for rust-bpf [1] that bumps BPF_MAX_SUBPROGS to 1024.
Rust crates have more than 256 functions that are not inlined.
Time in add_subprogs() when veristat loads sched_ext schedulers from scx
repo, 8 cpu VM, usec:
subprogs before after
arena_selftest 101 386 27
lavd_enqueue 52 96 16
lavd_dispatch 48 78 11
[1] https://github.com/4ast/rust-bpf
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Mahe Tardy <mahe.tardy@gmail.com>
Link: https://patch.msgid.link/20261023150302.4097865-1-alexei.starovoitov@gmail.com
Diffstat (limited to 'include/uapi/linux')
0 files changed, 0 insertions, 0 deletions
