[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250827123814.60217-1-dongml2@chinatelecom.cn>
Date: Wed, 27 Aug 2025 20:38:14 +0800
From: Menglong Dong <menglong8.dong@...il.com>
To: jolsa@...nel.org
Cc: ast@...nel.org,
daniel@...earbox.net,
andrii@...nel.org,
martin.lau@...ux.dev,
eddyz87@...il.com,
song@...nel.org,
yonghong.song@...ux.dev,
john.fastabend@...il.com,
kpsingh@...nel.org,
sdf@...ichev.me,
haoluo@...gle.com,
mattbobrowski@...gle.com,
rostedt@...dmis.org,
mhiramat@...nel.org,
mathieu.desnoyers@...icios.com,
bpf@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org
Subject: [PATCH bpf-next] 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 <dongml2@...natelecom.cn>
---
kernel/trace/bpf_trace.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 606007c387c5..0e79fa84a634 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -2741,12 +2741,10 @@ kprobe_multi_link_prog_run(struct bpf_kprobe_multi_link *link,
goto out;
}
- rcu_read_lock();
regs = ftrace_partial_regs(fregs, bpf_kprobe_multi_pt_regs_ptr());
old_run_ctx = bpf_set_run_ctx(&run_ctx.session_ctx.run_ctx);
err = bpf_prog_run(link->link.prog, regs);
bpf_reset_run_ctx(old_run_ctx);
- rcu_read_unlock();
out:
__this_cpu_dec(bpf_prog_active);
--
2.51.0
Powered by blists - more mailing lists