From 2614f3a6a8cb738421a8b98ae261658b47709567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=8D=9A=E8=BF=9C?= <2022211680@bupt.cn> Date: Sat, 28 Dec 2024 03:16:25 +0000 Subject: [PATCH] update kernel/trace/bpf_trace.c. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张博远 <2022211680@bupt.cn> --- kernel/trace/bpf_trace.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c index 981a4ad103eb..737786f4ce3a 100644 --- a/kernel/trace/bpf_trace.c +++ b/kernel/trace/bpf_trace.c @@ -2221,7 +2221,12 @@ void perf_event_detach_bpf_prog(struct perf_event *event) rcu_assign_pointer(event->tp_event->prog_array, new_array); bpf_prog_array_free_sleepable(old_array); } - + /* + * It could be that the bpf_prog is not sleepable (and will be freed + * via normal RCU), but is called from a point that supports sleepable + * programs and uses tasks-trace-RCU. + */ + synchronize_rcu_tasks_trace(); bpf_prog_put(event->prog); event->prog = NULL; -- Gitee