Re: [for-next][PATCH 26/26] tracing: trigger: Replace unneeded RCU-list traversals

From: Steven Rostedt
Date: Tue Jan 14 2020 - 17:11:35 EST


On Tue, 14 Jan 2020 16:03:42 -0500
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> From: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
>
> 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@xxxxxxxxxx>
> Signed-off-by: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
> Signed-off-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx>
> ---
> 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