RFC bpf: Fast-Path approach for BPF program
Get series with b4
b4 am [email protected]Versions newest first
- v2 RFC Latest4 patches 14 repliesIn review
Changes in v2 from the cover letter
- Patch generation has been moved after verification and before JIT.
- Now patch generation handles both helpers and kfuncs.
- Sanity check on original prog and patch prog after JIT.
- Runtime termination handler is now global termination mechanism using text_poke.
- Termination is triggered by watchdog timer.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | bpf: Introduce new structs and struct fieldsinclude/ kernel/ | +54 | 0 replies | |
| 2/4 | bpf: Generating a stubbed version of BPF program for terminationinclude/ include/ kernel/ +2 more | +276 | 3 replies | |
| 3/4 | bpf: Runtime part of fast-path termination approachinclude/ include/ kernel/ +2 more | +267 | 10 replies | |
| 4/4 | selftests/bpf: Adds selftests to check termination of long running nested bpf loopstools/ tools/ | +77 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [RFC bpf-next v2 0/4] bpf: Fast-Path approach for BPF program
This is RFC v2 of
https://lore.kernel.org/bpf/[email protected]/
Change since v1:
- Patch generation has been moved after verification and before JIT.
- Now patch generation handles both helpers and kfuncs.
- Sanity check on original prog and patch prog after JIT.
- Runtime termination handler is now global termination mechanism using text_poke.
- Termination is triggered by watchdog timer.
TODO:
- Termination support for tailcall programs.
- Fix issue caused by warning in runtime termination handler due to
https://elixir.bootlin.com/linux/v6.15.1/source/kernel/smp.c#L815
- Free memory for patch progs related fields.
- Include selftests covering more cases such as BPF program nesting.
include/linux/bpf.h | 19 +- include/linux/bpf_verifier.h | 4 + include/linux/filter.h | 43 ++- kernel/bpf/core.c | 64 +++++ kernel/bpf/syscall.c | 225 ++++++++++++++++ kernel/bpf/trampoline.c | 5 + kernel/bpf/verifier.c | 245 +++++++++++++++++- .../bpf/prog_tests/bpf_termination.c | 39 +++ .../selftests/bpf/progs/bpf_termination.c | 38 +++ 9 files changed, 674 insertions(+), 8 deletions(-) create mode 100644 tools/testing/selftests/bpf/prog_tests/bpf_termination.c create mode 100644 tools/testing/selftests/bpf/progs/bpf_termination.c
Signature · 1 line
2.43.0