Skip to content

Commit 6941035

Browse files
image-dragonKernel Patches Daemon
authored andcommitted
bpf: remove unnecessary rcu_read_lock in kprobe_multi_link_prog_run
Preemption is disabled in ftrace graph, which indicate rcu_read_lock. So the rcu_read_lock is not needed in fprobe_entry(), and it is not needed in kprobe_multi_link_prog_run() neither. Signed-off-by: Menglong Dong <[email protected]>
1 parent 8f9c214 commit 6941035

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

kernel/trace/bpf_trace.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2741,12 +2741,10 @@ kprobe_multi_link_prog_run(struct bpf_kprobe_multi_link *link,
27412741
goto out;
27422742
}
27432743

2744-
rcu_read_lock();
27452744
regs = ftrace_partial_regs(fregs, bpf_kprobe_multi_pt_regs_ptr());
27462745
old_run_ctx = bpf_set_run_ctx(&run_ctx.session_ctx.run_ctx);
27472746
err = bpf_prog_run(link->link.prog, regs);
27482747
bpf_reset_run_ctx(old_run_ctx);
2749-
rcu_read_unlock();
27502748

27512749
out:
27522750
__this_cpu_dec(bpf_prog_active);

0 commit comments

Comments
 (0)