On Thu, 18 Dec 2025 16:09:25 -0500
Steven Rostedt <[email protected]> wrote:
> On Thu, 18 Dec 2025 09:53:16 -0800
> Alexei Starovoitov <[email protected]> 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.

Reply via email to