]> git.dujemihanovic.xyz Git - linux.git/commit
tracing/user_events: Fixup enable faults asyncly
authorBeau Belgrave <beaub@linux.microsoft.com>
Tue, 28 Mar 2023 23:52:11 +0000 (16:52 -0700)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 29 Mar 2023 10:52:08 +0000 (06:52 -0400)
commit81f8fb65499817a4d1d5d66d9e74a903061ce637
tree99c66831259ddb194f149150a1858efa1a7f764e
parent7235759084a4f8524a46bd2638885ff3b34ce279
tracing/user_events: Fixup enable faults asyncly

When events are enabled within the various tracing facilities, such as
ftrace/perf, the event_mutex is held. As events are enabled pages are
accessed. We do not want page faults to occur under this lock. Instead
queue the fault to a workqueue to be handled in a process context safe
way without the lock.

The enable address is marked faulting while the async fault-in occurs.
This ensures that we don't attempt to fault-in more than is necessary.
Once the page has been faulted in, an address write is re-attempted.
If the page couldn't fault-in, then we wait until the next time the
event is enabled to prevent any potential infinite loops.

Link: https://lkml.kernel.org/r/20230328235219.203-5-beaub@linux.microsoft.com
Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace_events_user.c