From: Steven Rostedt (VMware) Date: Tue, 30 Jun 2020 13:04:35 +0000 (-0400) Subject: ring-buffer: Mark the !tail (crossing a page) as unlikely X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=75b21c6dfa2d816bcabac24a530d9cffc12092b8;p=linux.git ring-buffer: Mark the !tail (crossing a page) as unlikely 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 Signed-off-by: Steven Rostedt (VMware) --- diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index ed1941304f698..888bc91779372 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 */