lkml.org 
[lkml]   [2020]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [for-next][PATCH 26/26] tracing: trigger: Replace unneeded RCU-list traversals
On Tue, 14 Jan 2020 16:03:42 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> From: Masami Hiramatsu <mhiramat@kernel.org>
>
> With CONFIG_PROVE_RCU_LIST, I had many suspicious RCU warnings
> when I ran ftracetest trigger testcases.
>
> -----
> # dmesg -c > /dev/null
> # ./ftracetest test.d/trigger
> ...
> # dmesg | grep "RCU-list traversed" | cut -f 2 -d ] | cut -f 2 -d " "
> kernel/trace/trace_events_hist.c:6070
> kernel/trace/trace_events_hist.c:1760
> kernel/trace/trace_events_hist.c:5911
> kernel/trace/trace_events_trigger.c:504
> kernel/trace/trace_events_hist.c:1810
> kernel/trace/trace_events_hist.c:3158
> kernel/trace/trace_events_hist.c:3105
> kernel/trace/trace_events_hist.c:5518
> kernel/trace/trace_events_hist.c:5998
> kernel/trace/trace_events_hist.c:6019
> kernel/trace/trace_events_hist.c:6044
> kernel/trace/trace_events_trigger.c:1500
> kernel/trace/trace_events_trigger.c:1540
> kernel/trace/trace_events_trigger.c:539
> kernel/trace/trace_events_trigger.c:584
> -----
>
> I investigated those warnings and found that the RCU-list
> traversals in event trigger and hist didn't need to use
> RCU version because those were called only under event_mutex.
>
> I also checked other RCU-list traversals related to event
> trigger list, and found that most of them were called from
> event_hist_trigger_func() or hist_unregister_trigger() or
> register/unregister functions except for a few cases.
>
> Replace these unneeded RCU-list traversals with normal list
> traversal macro and lockdep_assert_held() to check the
> event_mutex is held.
>
> Link: http://lkml.kernel.org/r/157680910305.11685.15110237954275915782.stgit@devnote2
>
> Reviewed-by: Tom Zanussi <zanussi@kernel.org>
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> ---
> kernel/trace/trace_events_hist.c | 41 +++++++++++++++++++++--------
> kernel/trace/trace_events_trigger.c | 20 ++++++++++----
> 2 files changed, 45 insertions(+), 16 deletions(-)
>


I think I may add this to my urgent branch and mark this for stable.

-- Steve

\
 
 \ /
  Last update: 2020-01-14 23:12    [W:0.074 / U:5.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site