linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH] fs/buffer.c: exit if already confirmed page has dirty and writeback buffers
@ 2013-11-05 10:02 Gu Zheng
  2013-11-07 11:44 ` Jan Kara
  0 siblings, 1 reply; 3+ messages in thread
From: Gu Zheng @ 2013-11-05 10:02 UTC (permalink / raw)
  To: Al Viro; +Cc: fsdevel, linux-kernel

Stop the loop of iterating bh if we have confirmed page
has dirty and writeback buffers.

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RESEND PATCH] fs/buffer.c: exit if already confirmed page has dirty and writeback buffers
  2013-11-05 10:02 [RESEND PATCH] fs/buffer.c: exit if already confirmed page has dirty and writeback buffers Gu Zheng
@ 2013-11-07 11:44 ` Jan Kara
  2013-11-08  9:56   ` Gu Zheng
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kara @ 2013-11-07 11:44 UTC (permalink / raw)
  To: Gu Zheng; +Cc: Al Viro, fsdevel, linux-kernel

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). For the case where blocksize < pagesize we can
possibly save checking some buffers but how common is that going be? Does
that minimal speed up outweight the cost of additional check / code
complication?

								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
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RESEND PATCH] fs/buffer.c: exit if already confirmed page has dirty and writeback buffers
  2013-11-07 11:44 ` Jan Kara
@ 2013-11-08  9:56   ` Gu Zheng
  0 siblings, 0 replies; 3+ messages in thread
From: Gu Zheng @ 2013-11-08  9:56 UTC (permalink / raw)
  To: Jan Kara; +Cc: Al Viro, fsdevel, linux-kernel

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-11-08 10:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-05 10:02 [RESEND PATCH] fs/buffer.c: exit if already confirmed page has dirty and writeback buffers Gu Zheng
2013-11-07 11:44 ` Jan Kara
2013-11-08  9:56   ` Gu Zheng

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 NNTP newsgroup(s).