diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-04-29 00:26:30 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-04-29 00:26:30 -0400 |
commit | f2957f1f196b0217644a17c1379855a118a37d72 (patch) | |
tree | f033fac7d01e029f1b3fb5c39f37a80a5e861c4d /kernel/trace/trace.c | |
parent | 93459c6cb9816c52200993d29dd18cea1daee335 (diff) |
tracing: have splice only copy full pages
Splice works with pages, it is much more effecient to use an entire
page than to copy bits over several pages.
Using logdev to trace the internals of the splice mechanism, I was
able to see that splice can be very aggressive. When tracing is
occurring, and the reader caught up to the writer, and the writer
is on the reader page, the reader will copy what is there into the
splice page. Splice may iterate over several pages and if the
writer is still writing to the page, the reader will keep copying
bits to new pages to pass to userspace.
This patch changes it to only pass data to userspace if the page
is full (the writer has left the page). This has a small side effect
that splice can not read a partial page, and must wait for the
page to fill. This should not be an issue. If tracing has stopped,
then a use of "read" will still read all of the page.
[ Impact: better performance for ring buffer splice code ]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 0aeb3b93414e..f5427e0fc982 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -3542,7 +3542,7 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos, | |||
3542 | } | 3542 | } |
3543 | 3543 | ||
3544 | r = ring_buffer_read_page(ref->buffer, &ref->page, | 3544 | r = ring_buffer_read_page(ref->buffer, &ref->page, |
3545 | len, info->cpu, 0); | 3545 | len, info->cpu, 1); |
3546 | if (r < 0) { | 3546 | if (r < 0) { |
3547 | ring_buffer_free_read_page(ref->buffer, | 3547 | ring_buffer_free_read_page(ref->buffer, |
3548 | ref->page); | 3548 | ref->page); |