aboutsummaryrefslogtreecommitdiff
path: root/kernel/trace/trace_sched_wakeup.c
diff options
context:
space:
mode:
authorGravatar Steven Rostedt (Red Hat) <rostedt@goodmis.org> 2016-12-08 12:40:18 -0500
committerGravatar Steven Rostedt <rostedt@goodmis.org> 2016-12-09 09:18:14 -0500
commit656c7f0d2d2b3237a31b105d5ed217a65350104f (patch)
tree19ec88d4f4a29c68f4c7ef650a929c82bb858fed /kernel/trace/trace_sched_wakeup.c
parentftrace/x86_32: Set ftrace_stub to weak to prevent gcc from using short jumps ... (diff)
downloadlinux-656c7f0d2d2b3237a31b105d5ed217a65350104f.tar.gz
linux-656c7f0d2d2b3237a31b105d5ed217a65350104f.tar.bz2
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_sched_wakeup.c')
0 files changed, 0 insertions, 0 deletions