Skip to content

Commit

Permalink
ring-buffer: Process commits whenever moving to a new page.
Browse files Browse the repository at this point in the history
When crossing over to a new page, commit the current work. This will allow
readers to get data with less latency, and also simplifies the work to get
timestamps working for interrupted events.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt (Red Hat) committed Nov 25, 2015
1 parent 7000498 commit 4239c38
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions kernel/trace/ring_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2129,6 +2129,8 @@ rb_reset_tail(struct ring_buffer_per_cpu *cpu_buffer,
local_sub(length, &tail_page->write);
}

static inline void rb_end_commit(struct ring_buffer_per_cpu *cpu_buffer);

/*
* This is the slow path, force gcc not to inline it.
*/
Expand Down Expand Up @@ -2220,6 +2222,11 @@ rb_move_tail(struct ring_buffer_per_cpu *cpu_buffer,

rb_reset_tail(cpu_buffer, tail, info);

/* Commit what we have for now. */
rb_end_commit(cpu_buffer);
/* rb_end_commit() decs committing */
local_inc(&cpu_buffer->committing);

/* fail and let the caller try again */
return ERR_PTR(-EAGAIN);

Expand Down

0 comments on commit 4239c38

Please sign in to comment.