• Steven Rostedt's avatar
    tracing: have splice only copy full pages · f2957f1f
    Steven Rostedt authored
    Splice works with pages, it is much more effecient to use an entire
    page than to copy bits over several pages.
    
    Using logdev to trace the internals of the splice mechanism, I was
    able to see that splice can be very aggressive. When tracing is
    occurring, and the reader caught up to the writer, and the writer
    is on the reader page, the reader will copy what is there into the
    splice page. Splice may iterate over several pages and if the
    writer is still writing to the page, the reader will keep copying
    bits to new pages to pass to userspace.
    
    This patch changes it to only pass data to userspace if the page
    is full (the writer has left the page). This has a small side effect
    that splice can not read a partial page, and must wait for the
    page to fill. This should not be an issue. If tracing has stopped,
    then a use of "read" will still read all of the page.
    
    [ Impact: better performance for ring buffer splice code ]
    Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
    f2957f1f
trace.c 96.5 KB