[PATCH v3 03/22] bpf: Mark bpf_spin_lock helpers notrace
bot+bpf-ci at kernel.org
bot+bpf-ci at kernel.org
Mon Nov 30 20:55:39 PST 2026
> bpf: Mark bpf_spin_lock helpers notrace
TL;DR: Commit message only: the claim that nothing called by
bpf_spin_lock()/unlock() is traceable looks inaccurate, since out-of-line
callees like queued_spin_release_traced() and the qspinlock slowpath remain
traceable; narrow it or cover them.
> bpf: Mark bpf_spin_lock helpers notrace
>
> [ ... ]
> __bpf_spin_unlock_irqrestore(), __bpf_spin_unlock()
> and queued_spin_unlock() run with the lock held, so an fentry program
> attached to an out-of-line copy of one of them can hit the same
> deadlock. These copies are untraced today only because inline implies
> notrace.
> Mark all of these helpers notrace explicitly, so that nothing called by
> bpf_spin_lock() and bpf_spin_unlock() is traceable. No functional
> change.
> [ ... ]
> Signed-off-by: Song Liu <song at kernel.org>
Is the claim that "nothing called by bpf_spin_lock() and bpf_spin_unlock()
is traceable" accurate?
The patch only covers the inline helpers, and btf_id_deny in
kernel/bpf/verifier.c has no lock entries. Some out-of-line callees
remain traceable.
With CONFIG_QUEUED_SPINLOCKS_TRACE_CONTENDED_RELEASE and no x86
PARAVIRT_SPINLOCKS, the generic queued_spin_unlock() calls the extern
queued_spin_release_traced():
kernel/locking/qspinlock.c:queued_spin_release_traced()
It runs with the lock still held, which is the same deadlock the message
describes, and it is not marked notrace (qspinlock.o is not built without
-pg).
queued_spin_lock_slowpath() / native_queued_spin_lock_slowpath() in
qspinlock.c is also a traceable out-of-line function called from the
bpf_spin_lock() path.
The x86 "static inline queued_spin_lock_slowpath" wrapper and
native_queued_spin_unlock() in paravirt-spinlock.h are plain inline and
are not marked. The end of this series (a833438864c3) removes notrace from
inline, so an out-of-line copy of that wrapper in helpers.c would then
become traceable.
Could the sentence be narrowed, or should these callees be covered as well?
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/46577721107
More information about the linux-arm-kernel
mailing list