lkml.org 
[lkml]   [2020]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[for-next][PATCH 14/18] ring-buffer: Mark the !tail (crossing a page) as unlikely
    From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

    It is the uncommon case where an event crosses a sub buffer boundary (page)
    mark that check at the end of reserving an event as unlikely.

    Suggested-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
    Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
    ---
    kernel/trace/ring_buffer.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
    index ed1941304f69..888bc9177937 100644
    --- a/kernel/trace/ring_buffer.c
    +++ b/kernel/trace/ring_buffer.c
    @@ -3260,7 +3260,7 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer,
    * If this is the first commit on the page, then update
    * its timestamp.
    */
    - if (!tail)
    + if (unlikely(!tail))
    tail_page->page->time_stamp = info->ts;

    /* account for these added bytes */
    --
    2.26.2

    \
     
     \ /
      Last update: 2020-07-03 00:00    [W:5.379 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site