From: sashiko-bot@kernel.org
To: "Mike Bazov" <mikeba@sentinelone.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH RFC bpf-next 1/2] bpf: Keep recursion-checked trampoline programs non-preemptible on !PREEMPT_RT
Date: Sun, 25 Oct 2026 11:38:34 +0000 [thread overview]
Message-ID: <sashiko-outbox-184195@kernel.org> (raw)
In-Reply-To: <20261025-b4-bpf-trampoline-preempt-v1-1-198dcdc0c6ac@sentinelone.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] bpf: multi-line comment style violation in __bpf_prog_enter_recur()
--
commit 264a83620cb7c053d29054a8d674730e0e75ac83
Author: Mike Bazov <mikeba@sentinelone.com>
bpf: Keep recursion-checked trampoline programs non-preemptible on !PREEMPT_RT
This commit disables preemption in __bpf_prog_enter_recur() and
__bpf_prog_exit_recur() when CONFIG_PREEMPT_RT is disabled so that
per-CPU recursion tracking and per-CPU private stacks are not shared
across preempted tasks on the same CPU.
> diff --git a/kernel/bpf/trampoline.c b/kernel/bpf/trampoline.c
> index bf4cb3dd444d6..632c104112b2e 100644
> --- a/kernel/bpf/trampoline.c
> +++ b/kernel/bpf/trampoline.c
> @@ -1339,7 +1339,15 @@ static __always_inline u64 notrace bpf_prog_start_time(void)
> static u64 notrace __bpf_prog_enter_recur(struct bpf_prog *prog, struct bpf_tramp_run_ctx *run_ctx)
> __acquires(RCU)
> {
> - rcu_read_lock_dont_migrate();
> + if (IS_ENABLED(CONFIG_PREEMPT_RT)) {
> + rcu_read_lock_dont_migrate();
> + } else {
> + /* prog->active and the private stack are per-CPU: don't let
> + * another task run on this CPU while we hold them.
> + */
[Severity: Low]
This isn't a bug, but in __bpf_prog_enter_recur() in
kernel/bpf/trampoline.c, could this multi-line comment place the opening
/* on its own line to follow the BPF subsystem comment style?
/*
* prog->active and the private stack are per-CPU: don't let
* another task run on this CPU while we hold them.
*/
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261025-b4-bpf-trampoline-preempt-v1-0-198dcdc0c6ac@sentinelone.com?part=1
next prev parent reply other threads:[~2026-10-25 11:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-25 11:02 [PATCH RFC bpf-next 0/2] bpf: Do not let preemption cause false recursion drops in trampoline progs Mike Bazov via B4 Relay
2026-10-25 11:02 ` Mike Bazov
2026-10-25 11:02 ` [PATCH RFC bpf-next 1/2] bpf: Keep recursion-checked trampoline programs non-preemptible on !PREEMPT_RT Mike Bazov via B4 Relay
2026-10-25 11:02 ` Mike Bazov
2026-10-25 11:38 ` sashiko-bot [this message]
2026-10-25 11:02 ` [PATCH RFC bpf-next 2/2] selftests/bpf: Add trampoline preemption false-recursion test Mike Bazov via B4 Relay
2026-10-25 11:02 ` Mike Bazov
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=sashiko-outbox-184195@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=mikeba@sentinelone.com \
--cc=sashiko-reviews@lists.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 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.