Skip to content

Commit

Permalink
ring-buffer: Mark the !tail (crossing a page) as unlikely
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steven Rostedt (VMware) committed Jun 30, 2020
1 parent b23d7a5 commit 75b21c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/ring_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 75b21c6

Please sign in to comment.