[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A9E20BF.6000609@cn.fujitsu.com>
Date: Wed, 02 Sep 2009 15:37:35 +0800
From: Lai Jiangshan <laijs@...fujitsu.com>
To: Frederic Weisbecker <fweisbec@...il.com>
CC: Ingo Molnar <mingo@...e.hu>, Steven Rostedt <rostedt@...dmis.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/3] tracing: make splice_read work when data is sufficient
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists