From: Varun R Mallya <varunrmallya@gmail.com>
To: Jiri Olsa <olsajiri@gmail.com>
Cc: andrii@kernel.org, alan.maguire@oracle.com,
yonghong.song@linux.dev, song@kernel.org, bpf@vger.kernel.org,
ast@kernel.org, daniel@iogearbox.net, memxor@gmail.com,
eddyz87@gmail.com, martin.lau@linux.dev,
menglong8.dong@gmail.com, puranjay@kernel.org, bjorn@kernel.org,
leon.hwang@linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH bpf-next v2 3/3] libbpf: Auto-upgrade kprobes to multi-kprobes when supported
Date: Wed, 1 Apr 2026 16:41:06 +0530 [thread overview]
Message-ID: <acz9SosYy2-pAKRS@computer> (raw)
In-Reply-To: <aczsqSHLdM1KtFFH@computer>
On Wed, Apr 01, 2026 at 04:23:15PM +0530, Varun R Mallya wrote:
> I had to add that check because selftests/bpf/prog_tests/attach_probe.c
> was failing. Sleepable kprobes are not supposed to attach successfully,
> but since this was upgraded to multi, it was doing so. So, I had to stop
> all sleepable kprobes from being upgraded to maintain compatibility.
>
> I'd like to know if kprobe_multi is even allowed to be sleepable. I
> could not really find any selftests or patches for sleepable kprobe_multi
> functionality anywhere, so I just want to check if this is not actually
> intended behaviour and we are missing a check somewhere.
>
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 0b040a417442..af7079aa0f36 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -2752,6 +2752,10 @@ int bpf_kprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *pr
if (!is_kprobe_multi(prog))
return -EINVAL;
+ /* kprobe_multi is not allowed to be sleepable. */
+ if (prog->sleepable)
+ return -EINVAL;
+
/* Writing to context is not allowed for kprobes. */
if (prog->aux->kprobe_write_ctx)
return -EINVAL;
Adding this removes the need for me to add the sleepable check. Should I
send a patch with this or am I making a mistake here ??
Sleepability for kprobe_multi was never checked (If it's meant to not be
sleepable, that is.)
prev parent reply other threads:[~2026-04-01 11:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-30 11:00 [RFC PATCH bpf-next v2 0/3] Upgrading uprobe and kprobe to their `multi` counterparts Varun R Mallya
2026-03-30 11:00 ` [RFC PATCH bpf-next v2 1/3] libbpf: Auto-upgrade uprobes to multi-uprobes when supported Varun R Mallya
2026-03-30 11:47 ` bot+bpf-ci
2026-03-30 14:52 ` Jiri Olsa
2026-04-01 9:56 ` Varun R Mallya
2026-03-30 11:00 ` [RFC PATCH bpf-next v2 2/3] libbpf: Add FEAT_KPROBE_MULTI_LINK feature probe Varun R Mallya
2026-03-30 14:42 ` Leon Hwang
2026-04-01 9:57 ` Varun R Mallya
2026-03-30 14:52 ` Jiri Olsa
2026-04-01 9:49 ` Varun R Mallya
2026-03-30 11:00 ` [RFC PATCH bpf-next v2 3/3] libbpf: Auto-upgrade kprobes to multi-kprobes when supported Varun R Mallya
2026-03-30 11:47 ` bot+bpf-ci
2026-04-01 9:59 ` Varun R Mallya
2026-03-30 14:53 ` Jiri Olsa
2026-04-01 10:53 ` Varun R Mallya
2026-04-01 11:11 ` Varun R Mallya [this message]
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=acz9SosYy2-pAKRS@computer \
--to=varunrmallya@gmail.com \
--cc=alan.maguire@oracle.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=leon.hwang@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=menglong8.dong@gmail.com \
--cc=olsajiri@gmail.com \
--cc=puranjay@kernel.org \
--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