From: liujing40 <liujing.root@gmail.com>
To: rostedt@goodmis.org
Cc: alexei.starovoitov@gmail.com, andrii@kernel.org, ast@kernel.org,
bpf@vger.kernel.org, daniel@iogearbox.net, eddyz87@gmail.com,
haoluo@google.com, john.fastabend@gmail.com, jolsa@kernel.org,
kpsingh@kernel.org, linux-kernel@vger.kernel.org,
linux-trace-kernel@vger.kernel.org, liujing.root@gmail.com,
liujing40@xiaomi.com, martin.lau@linux.dev, mhiramat@kernel.org,
sdf@fomichev.me, song@kernel.org, yonghong.song@linux.dev
Subject: Re: [PATCH 2/2] bpf: Implement kretprobe fallback for kprobe multi link
Date: Mon, 22 Dec 2025 16:00:46 +0800 [thread overview]
Message-ID: <20251222080046.2312024-1-liujing40@xiaomi.com> (raw)
In-Reply-To: <20251218160925.3c02a721@gandalf.local.home>
On Thu, 18 Dec 2025 16:09:25 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:
> On Thu, 18 Dec 2025 09:53:16 -0800
> Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
>
> > > +static void bpf_kprobe_unregister(struct bpf_kprobe *kps, u32 cnt)
> > > +{
> > > + for (int i = 0; i < cnt; i++)
> > > + unregister_kretprobe(&kps[i].rp);
> > > +}
> >
> > Nack.
> > This is not a good idea.
> > unregister_kretprobe() calls synchronize_rcu().
> > So the above loop will cause soft lockups for sure.
>
> Looks like it could be replaced with:
>
> unregister_kretprobes(kps, cnt);
>
> Which unregisters an array of kreptrobes and does a single
> synchronize_rcu().
>
> -- Steve
Thanks for the suggestion. I will refactor the loop to use
unregister_kretprobes() for a single RCU sync.
next prev parent reply other threads:[~2025-12-22 8:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-18 13:06 [PATCH 0/2] bpf: Add kretprobe fallback for kprobe multi link liujing40
2025-12-18 13:06 ` [PATCH 1/2] bpf: Prepare for kprobe multi link fallback patch liujing40
2025-12-18 13:06 ` [PATCH 2/2] bpf: Implement kretprobe fallback for kprobe multi link liujing40
2025-12-18 13:33 ` bot+bpf-ci
2026-01-29 0:13 ` Masami Hiramatsu
2025-12-18 17:53 ` Alexei Starovoitov
2025-12-18 21:09 ` Steven Rostedt
2025-12-22 8:00 ` liujing40 [this message]
2025-12-19 1:57 ` Menglong Dong
2025-12-22 8:02 ` liujing40
2025-12-22 17:15 ` Steven Rostedt
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=20251222080046.2312024-1-liujing40@xiaomi.com \
--to=liujing.root@gmail.com \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=liujing40@xiaomi.com \
--cc=martin.lau@linux.dev \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
--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