Skip to content
  • Steven Rostedt's avatar
    tracing: Do not allocate buffer for trace_marker · d696b58c
    Steven Rostedt authored
    
    
    When doing intense tracing, the kmalloc inside trace_marker can
    introduce side effects to what is being traced.
    
    As trace_marker() is used by userspace to inject data into the
    kernel ring buffer, it needs to do so with the least amount
    of intrusion to the operations of the kernel or the user space
    application.
    
    As the ring buffer is designed to write directly into the buffer
    without the need to make a temporary buffer, and userspace already
    went through the hassle of knowing how big the write will be,
    we can simply pin the userspace pages and write the data directly
    into the buffer. This improves the impact of tracing via trace_marker
    tremendously!
    
    Thanks to Peter Zijlstra and Thomas Gleixner for pointing out the
    use of get_user_pages_fast() and kmap_atomic().
    
    Suggested-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Suggested-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
    Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
    d696b58c