From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>, Steven Rostedt <rostedt@goodmis.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] tracing: make splice_read work when data is sufficient
Date: Wed, 02 Sep 2009 15:37:35 +0800 [thread overview]
Message-ID: <4A9E20BF.6000609@cn.fujitsu.com> (raw)
In-Reply-To: <20090901223659.GB6108@nowhere>
Frederic Weisbecker wrote:
> On Tue, Sep 01, 2009 at 08:29:53PM +0800, Lai Jiangshan wrote:
>> Frederic Weisbecker wrote:
>>>> */
>>>> + cpu_buffer->reader_page->read = 0;
>>>
>>>
>>> Wasn't this reset done before?
>>>
>>>
>> This is not reset. It is still used just before this line.
>
>
>
> Yeah but after that it's not used anymore because this page
It may be used in next rb_get_reader_page(), see next:
> won't anymore be used as a reader page but will be integrated
> as a writable ring buffer page.
>
> One day it may be reused as a reader page still, but before
> any use, rb_reset_reader_page() will be called to reset this offset.
>
> So I just don't understand why you need to do that.
>
>
Oh, I know what you mean.
My patch changes the rb_get_reader_page().
rb_get_reader_page(cpu_buffer, 0) is still the same behavior exactly as before.
But rb_get_reader_page(cpu_buffer, 1) returns NULL when
reader page is empty and head page is not full,
in this condition, we do local_set(&cpu_buffer->reader_page->page->commit, 0),
so we need reset cpu_buffer->reader_page->read. Because cpu_buffer->reader_page
will be accessed again in next rb_get_reader_page().
Lai
next prev parent reply other threads:[~2009-09-02 7:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-27 3:02 [PATCH 1/3] tracing: make splice_read work when data is sufficient Lai Jiangshan
2009-08-29 9:45 ` Frederic Weisbecker
2009-09-01 12:29 ` Lai Jiangshan
2009-09-01 22:37 ` Frederic Weisbecker
2009-09-02 7:37 ` Lai Jiangshan [this message]
2009-09-09 20:51 ` 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=4A9E20BF.6000609@cn.fujitsu.com \
--to=laijs@cn.fujitsu.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.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