From: Jeff Moyer <jmoyer@redhat.com>
To: Jan Kara <jack@suse.cz>
Cc: linux-fsdevel@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>, Jens Axboe <axboe@kernel.dk>
Subject: Re: Read starvation by sync writes
Date: Tue, 11 Dec 2012 16:44:15 -0500 [thread overview]
Message-ID: <x49ehiw2rio.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <20121210221222.GA25700@quack.suse.cz> (Jan Kara's message of "Mon, 10 Dec 2012 23:12:22 +0100")
Jan Kara <jack@suse.cz> writes:
> Hi,
>
> I was looking into IO starvation problems where streaming sync writes (in
> my case from kjournald but DIO would look the same) starve reads. This is
> because reads happen in small chunks and until a request completes we don't
> start reading further (reader reads lots of small files) while writers have
> plenty of big requests to submit. Both processes end up fighting for IO
> requests and writer writes nr_batching 512 KB requests while reader reads
> just one 4 KB request or so. Here the effect is magnified by the fact that
> the drive has relatively big queue depth so it usually takes longer than
> BLK_BATCH_TIME to complete the read request. The net result is it takes
> close to two minutes to read files that can be read under a second without
> writer load. Without the big drive's queue depth, results are not ideal but
> they are bearable - it takes about 20 seconds to do the reading. And for
> comparison, when writer and reader are not competing for IO requests (as it
> happens when writes are submitted as async), it takes about 2 seconds to
> complete reading.
>
> Simple reproducer is:
>
> echo 3 >/proc/sys/vm/drop_caches
> dd if=/dev/zero of=/tmp/f bs=1M count=10000 &
> sleep 30
> time cat /etc/* 2>&1 >/dev/null
> killall dd
> rm /tmp/f
This is a buffered writer. How does it end up that you are doing all
synchronous write I/O? Also, you forgot to mention what file system you
were using, and which I/O scheduler.
Is this happening in some real workload? If so, can you share what that
workload is? How about some blktrace data?
> The question is how can we fix this? Two quick hacks that come to my mind
> are remove timeout from the batching logic (is it that important?) or
> further separate request allocation logic so that reads have their own
> request pool. More systematic fix would be to change request allocation
> logic to always allow at least a fixed number of requests per IOC. What do
> people think about this?
There has been talk of removing the limit on the number of requests
allocated, but I haven't seen patches for it, and I certainly am not
convinced of its practicality. Today, when using block cgroups you do
get a request list per cgroup, so that's kind of the same thing as one
per ioc. I can certainly see moving in that direction for the
non-cgroup case.
First, though, I'd like to better understand your workload.
Cheers,
Jeff
next prev parent reply other threads:[~2012-12-11 21:45 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-10 22:12 Jan Kara
2012-12-11 21:44 ` Jeff Moyer [this message]
2012-12-12 2:31 ` Jan Kara
2012-12-12 4:18 ` Dave Chinner
2012-12-12 10:26 ` Jan Kara
2012-12-12 23:33 ` Dave Chinner
2012-12-12 0:13 ` Jan Engelhardt
2012-12-12 2:55 ` Shaohua Li
2012-12-12 10:11 ` Jan Kara
2012-12-12 15:19 ` Jens Axboe
2012-12-12 16:38 ` Jeff Moyer
2012-12-12 19:41 ` Jeff Moyer
2012-12-13 12:30 ` Jan Kara
2012-12-13 13:30 ` Jens Axboe
2012-12-13 14:55 ` Jeff Moyer
2012-12-13 15:02 ` Jan Kara
2012-12-13 18:03 ` Jens Axboe
2013-01-23 17:35 ` Jeff Moyer
2012-12-13 1:43 ` Shaohua Li
2012-12-13 10:32 ` Jan Kara
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=x49ehiw2rio.fsf@segfault.boston.devel.redhat.com \
--to=jmoyer@redhat.com \
--cc=axboe@kernel.dk \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®