tracing/user_events: Remove RCU lock while pinning pages
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 19 May 2023 23:07:39 +0000 (16:07 -0700)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 24 May 2023 01:05:04 +0000 (21:05 -0400)
commitaaecdaf922835ed9a8ce56cdd9a8d40fe630257a
tree8417b442e4650fda4f49ad0b0efaa6156490021a
parent3e0fea09b17fa2255f6cb0108bbffd4a505f8925
tracing/user_events: Remove RCU lock while pinning pages

pin_user_pages_remote() can reschedule which means we cannot hold any
RCU lock while using it. Now that enablers are not exposed out to the
tracing register callbacks during fork(), there is clearly no need to
require the RCU lock as event_mutex is enough to protect changes.

Remove unneeded RCU usages when pinning pages and walking enablers with
event_mutex held. Cleanup a misleading "safe" list walk that is not
needed. During fork() duplication, remove unneeded RCU list add, since
the list is not exposed yet.

Link: https://lkml.kernel.org/r/20230519230741.669-3-beaub@linux.microsoft.com
Link: https://lore.kernel.org/linux-trace-kernel/CAHk-=wiiBfT4zNS29jA0XEsy8EmbqTH1hAPdRJCDAJMD8Gxt5A@mail.gmail.com/
Fixes: 7235759084a4 ("tracing/user_events: Use remote writes for event enablement")
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ change log written by Beau Belgrave ]
Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace_events_user.c