diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2016-12-08 12:40:18 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2016-12-09 09:18:14 -0500 |
commit | 656c7f0d2d2b3237a31b105d5ed217a65350104f (patch) | |
tree | 19ec88d4f4a29c68f4c7ef650a929c82bb858fed /kernel/trace/trace_functions_graph.c | |
parent | 847fa1a6d3d00f3bdf68ef5fa4a786f644a0dd67 (diff) | |
download | blackbird-op-linux-656c7f0d2d2b3237a31b105d5ed217a65350104f.tar.gz blackbird-op-linux-656c7f0d2d2b3237a31b105d5ed217a65350104f.zip |
tracing: Replace kmap with copy_from_user() in trace_marker writing
Instead of using get_user_pages_fast() and kmap_atomic() when writing
to the trace_marker file, just allocate enough space on the ring buffer
directly, and write into it via copy_from_user().
Writing into the trace_marker file use to allocate a temporary buffer
to perform the copy_from_user(), as we didn't want to write into the
ring buffer if the copy failed. But as a trace_marker write is suppose
to be extremely fast, and allocating memory causes other tracepoints to
trigger, Peter Zijlstra suggested using get_user_pages_fast() and
kmap_atomic() to keep the user space pages in memory and reading it
directly. But Henrik Austad had issues with this because it required taking
the mm->mmap_sem and causing long delays with the write.
Instead, just allocate the space in the ring buffer and use
copy_from_user() directly. If it faults, return -EFAULT and write
"<faulted>" into the ring buffer.
Link: http://lkml.kernel.org/r/20161208124018.72dd0f86@gandalf.local.home
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Henrik Austad <henrik@austad.us>
Cc: Peter Zijlstra <peterz@infradead.org>
Updates: d696b58ca2c3ca "tracing: Do not allocate buffer for trace_marker"
Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace_functions_graph.c')
0 files changed, 0 insertions, 0 deletions