[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [dm-devel] [PATCH 1/2] dm-kcopyd: Remove BIO_RW_SYNCIO flag




On Thu, 22 Jul 2010, Mikulas Patocka wrote:

> Remove BIO_RW_SYNCIO flag from kcopyd
> 
> This improves write throughput twice when writing to the origin with snapshot
> on the same device.
> 
> I don't know the exact reason, BIO_RW_SYNCIO is not documented and
> its effects on queueing are not obvious from the code. There seem to
> be two sets of limits, one for sync and the other for async requests.

The reason is that with BIO_RW_SYNCIO CFQ scheduler doesn't merge write 
requests. It sends them one-by-one, so if the disk has for example 64 
tags, it sends out 64 one-chunk write requests.

On other i/o schedulers (noop and deadline), this patch has no effect.

Mikulas

> Signed-off-by: Mikulas Patocka <mpatocka redhat com>
> 
> ---
>  drivers/md/dm-kcopyd.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux-2.6.34-fast/drivers/md/dm-kcopyd.c
> ===================================================================
> --- linux-2.6.34-fast.orig/drivers/md/dm-kcopyd.c	2010-07-21 17:57:35.000000000 +0200
> +++ linux-2.6.34-fast/drivers/md/dm-kcopyd.c	2010-07-22 15:24:02.000000000 +0200
> @@ -345,7 +345,7 @@ static int run_io_job(struct kcopyd_job 
>  {
>  	int r;
>  	struct dm_io_request io_req = {
> -		.bi_rw = job->rw | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG),
> +		.bi_rw = job->rw | (1 << BIO_RW_UNPLUG),
>  		.mem.type = DM_IO_PAGE_LIST,
>  		.mem.ptr.pl = job->pages,
>  		.mem.offset = job->offset,
> 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]