LKML Archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [for-next][PATCH 1/5] ring-buffer: Process commits whenever moving to a new page.
Date: Wed, 25 Nov 2015 21:19:04 -0500	[thread overview]
Message-ID: <20151126022047.970712854@goodmis.org> (raw)
In-Reply-To: 20151126021903.416197072@goodmis.org

[-- Attachment #1: 0001-ring-buffer-Process-commits-whenever-moving-to-a-new.patch --]
[-- Type: text/plain, Size: 1167 bytes --]

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

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>
---
 kernel/trace/ring_buffer.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 631541a53baf..95181e36891a 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -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.
  */
@@ -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);
 
-- 
2.6.1



  reply	other threads:[~2015-11-26  2:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-26  2:19 [for-next][PATCH 0/5] tracing: Better output when ftrace_bug() is hit Steven Rostedt
2015-11-26  2:19 ` Steven Rostedt [this message]
2015-11-26  2:19 ` [for-next][PATCH 2/5] tracing: Update cond flag when enabling or disabling a trigger Steven Rostedt
2015-11-26  2:19 ` [for-next][PATCH 3/5] ftrace: Add new type to distinguish what kind of ftrace_bug() Steven Rostedt
2015-11-26  2:19 ` [for-next][PATCH 4/5] ftrace: Add variable ftrace_expected for archs to show expected code Steven Rostedt
2015-11-26  2:19 ` [for-next][PATCH 5/5] ftrace: Show all tramps registered to a record on ftrace_bug() Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151126022047.970712854@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).