From: Siddharth Chintamaneni <sidchintamaneni@gmail.com>
To: bpf@vger.kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org,
yonghong.song@linux.dev, john.fastabend@gmail.com,
kpsingh@kernel.org, sdf@fomichev.me, haoluo@google.com,
jolsa@kernel.org, djwillia@vt.edu, miloc@vt.edu, ericts@vt.edu,
rahult@vt.edu, doniaghazy@vt.edu, quanzhif@vt.edu,
jinghao7@illinois.edu, sidchintamaneni@gmail.com,
memxor@gmail.com, egor@vt.edu, sairoop10@gmail.com,
rjsu26@gmail.com
Subject: [PATCH 0/4] bpf: Fast-Path approach for BPF program termination
Date: Sun, 7 Sep 2025 23:04:11 +0000 [thread overview]
Message-ID: <20250907230415.289327-1-sidchintamaneni@gmail.com> (raw)
This is RFC v3 of
https://lore.kernel.org/all/20250614064056.237005-1-sidchintamaneni@gmail.com/
The termination handler call from the softlockup detector is mainly for
the demonstration of the entire workflow and also serves as a potential
use case for discussion. However, the runtime mechanism is modular
enough to be ported to different scenarios such as deadlocks, page
faults, userspace BPF management tools, and stack overflows.
The main changes that we bring in this version are: We have avoided the
memory overhead caused by program cloning in previous versions. During
normal program execution, none of the termination logic causes any
additional overhead.
Change log:
v2 -> v3:
- Cloning of BPF programs has been removed.
- Created call sites table to maintain helper/ kfunc call instruction
offsets.
- Termination is triggered inside the softlockup detector not affecting
any fast path operations.
v1 -> v2:
- 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.
arch/x86/net/bpf_jit_comp.c | 141 ++++++++++++++++++
include/linux/bpf.h | 77 ++++++----
include/linux/bpf_verifier.h | 1 +
include/linux/filter.h | 6 +
kernel/bpf/core.c | 67 +++++++++
kernel/bpf/verifier.c | 135 +++++++++++++++--
kernel/watchdog.c | 8 +
.../bpf/prog_tests/bpf_termination.c | 39 +++++
.../selftests/bpf/progs/bpf_termination.c | 47 ++++++
9 files changed, 482 insertions(+), 39 deletions(-)
create mode 100644 tools/testing/selftests/bpf/prog_tests/bpf_termination.c
create mode 100644 tools/testing/selftests/bpf/progs/bpf_termination.c
--
2.43.0
next reply other threads:[~2025-09-07 23:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-07 23:04 Siddharth Chintamaneni [this message]
2025-09-07 23:04 ` [PATCH 1/4] bpf: Introduce new structs and struct fields for fast path termination Siddharth Chintamaneni
2025-09-17 2:11 ` Kumar Kartikeya Dwivedi
2025-09-17 3:38 ` Siddharth Chintamaneni
2025-09-07 23:04 ` [PATCH 2/4] bpf: Creating call sites table to stub instructions during runtime Siddharth Chintamaneni
2025-09-07 23:04 ` [PATCH 3/4] bpf: runtime part of fast-path termination approach Siddharth Chintamaneni
2025-09-08 6:01 ` kernel test robot
2025-09-08 7:14 ` kernel test robot
2025-09-17 2:11 ` Kumar Kartikeya Dwivedi
2025-09-17 4:01 ` Siddharth Chintamaneni
2025-09-07 23:04 ` [PATCH 4/4] selftests/bpf: Adds selftests to check termination of long running nested bpf loops Siddharth Chintamaneni
2025-09-17 2:13 ` [PATCH 0/4] bpf: Fast-Path approach for BPF program termination Kumar Kartikeya Dwivedi
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=20250907230415.289327-1-sidchintamaneni@gmail.com \
--to=sidchintamaneni@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=djwillia@vt.edu \
--cc=doniaghazy@vt.edu \
--cc=eddyz87@gmail.com \
--cc=egor@vt.edu \
--cc=ericts@vt.edu \
--cc=haoluo@google.com \
--cc=jinghao7@illinois.edu \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=miloc@vt.edu \
--cc=quanzhif@vt.edu \
--cc=rahult@vt.edu \
--cc=rjsu26@gmail.com \
--cc=sairoop10@gmail.com \
--cc=sdf@fomichev.me \
--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