lkml.org 
[lkml]   [2013]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RESEND PATCH] fs/buffer.c: exit if already confirmed page has dirty and writeback buffers
Hi Jan,

On 11/07/2013 07:44 PM, Jan Kara wrote:

> On Tue 05-11-13 18:02:03, Gu Zheng wrote:
>> Stop the loop of iterating bh if we have confirmed page
>> has dirty and writeback buffers.
> Thanks for the patch. What I'm somewhat missing here is a motivation of
> the patch. For the common case where blocksize == pagesize this is a noop
> (only adds some code).

Yes, you're right.

> For the case where blocksize < pagesize we can
> possibly save checking some buffers but how common is that going be?

It's really hard to say.:( But many file systems support small blocksize.

> Does that minimal speed up outweight the cost of additional check / code
> complication?

In fact, without complete test. But I think the speed up can outweigh the cost
if blocksize small enough. For example, blocksize: 1k, pagesize: 4k, we can
reduce 6 bh check(3 dirty, 3 writeback) in the best case.

Best regards,
Gu

>
> Honza
>
>>
>> Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
>> ---
>> fs/buffer.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/fs/buffer.c b/fs/buffer.c
>> index 6024877..519cc5c 100644
>> --- a/fs/buffer.c
>> +++ b/fs/buffer.c
>> @@ -112,7 +112,7 @@ void buffer_check_dirty_writeback(struct page *page,
>> *dirty = true;
>>
>> bh = bh->b_this_page;
>> - } while (bh != head);
>> + } while ((bh != head) && !(*writeback && *dirty));
>> }
>> EXPORT_SYMBOL(buffer_check_dirty_writeback);
>>
>> --
>> 1.7.7
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html




\
 
 \ /
  Last update: 2013-11-08 11:41    [W:0.045 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site