dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	dm-devel@redhat.com, Alasdair G Kergon <agk@redhat.com>
Subject: Re: BIO_RW_SYNCIO
Date: Mon, 26 Jul 2010 22:09:19 -0400	[thread overview]
Message-ID: <20100727020919.GC18940@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1007261747560.12939@hs20-bc2-1.build.redhat.com>

On Mon, Jul 26, 2010 at 05:53:40PM -0400, Mikulas Patocka wrote:
> Hi Jens
> 
[ Jens's mail id has changed. Ccing him on different mail id ]

> I found out that when I remove BIO_RW_SYNCIO from dm-kcopyd.c, performance 
> when writing to the snapshot origin is increased twice. In this workload, 
> snapshot driver reads a lot of 8k chunks from one place on the disk and 
> writes them to the other place on the same disk. Without BIO_RW_SYNCIO, it 
> is twice faster with CFQ scheduler.
> 
> What does BIO_RW_SYNCIO exactly do?  Does it attempt to decrease latency 
> and decrease throughput? (so that disk head seeks more between the source 
> and destination and it causes performance degradation) Is there some 
> general guidance, when use BIO_RW_SYNCIO and when not?

BIO_RW_SYNC marks a request as SYNC. reads are by default sync. Writes
can be marked as SYNC so that they get priority of ASYNC WRITES.

Marking writes as SYNC has advantage that it gets its own queue, it can
preempt ASYNC WRITES and CFQ also idles on the cfq queue waiting for
more requests.

I suspect if it is idling on SYNC WRITES which is a problem here.

- Is it the same thread which is submitting both read and write requests?
- Are you interleaving reads and writes. Like reading some data, then
  writting it and reading again...

I guess after writting some data, CFQ is idling on WRITE_SYNC and next
READ does not get dispatched immediately to the disk.

Is it possible to provide some 30 second blktrace of the underlying device
where CFQ is running. You can also try setting slice_idle to 0 and see if
it helps.

If setting slice_idle=0 helps you, can you please also give a try to
following patch.

https://patchwork.kernel.org/patch/113061/

Thanks
Vivek

  reply	other threads:[~2010-07-27  2:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-16 23:52 [PATCH] fix crash in blk_queue_abort Mikulas Patocka
2009-04-17  6:36 ` Jens Axboe
2009-04-20  6:20   ` Mikulas Patocka
2009-04-21  7:29     ` Jens Axboe
2010-07-26 21:53       ` BIO_RW_SYNCIO Mikulas Patocka
2010-07-27  2:09         ` Vivek Goyal [this message]
2010-07-27 19:48           ` BIO_RW_SYNCIO Mikulas Patocka
2010-07-27 23:09             ` BIO_RW_SYNCIO Vivek Goyal
2010-07-28  1:33               ` BIO_RW_SYNCIO Vivek Goyal
2010-07-28 12:35                 ` BIO_RW_SYNCIO Mikulas Patocka
2010-07-28 12:42               ` BIO_RW_SYNCIO Mikulas Patocka
2010-07-28 15:44                 ` BIO_RW_SYNCIO Vivek Goyal

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=20100727020919.GC18940@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=agk@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@redhat.com \
    --cc=mpatocka@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).