From: Jens Axboe <qemu@kernel.dk>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [patch] non-blocking disk IO
Date: Tue, 4 Oct 2005 08:41:28 +0200 [thread overview]
Message-ID: <20051004064127.GE3511@suse.de> (raw)
In-Reply-To: <4341B0D3.7050804@stanfordalumni.org>
On Mon, Oct 03 2005, John Coiner wrote:
>
>
> Jens Axboe wrote:
> > Why not use aio for this instead, seems like a better fit than spawning
> >a thread per block device? That would still require a thread for
> >handling completions, but you could easily just use a single completion
> >thread for all devices for this as it would not need to do any real
> >work.
>
> Pthreads vs. AIO is an open question.
>
> The pthreads implementation works with all disk image formats, without
> modifying any format-specific code. To use AIO, each image format driver
> would have to be modified.
That is true, I appreciate why you did it the way you did. Using libaio
would be more invasive, indeed.
> QEMU already uses pthreads, therefore using pthreads does not add a new
> dependency on the host platform. (Or so I thought. The build on Windows
> broke anyway. Haha... my bad...)
>
> My questions are:
> * Which QEMU host platforms support Posix AIO?
> * Which host platform has the slowest pthreads library, and how many
> cycles will it waste on pthreads overhead?
> * What is the likely performance benefit of using AIO?
>
> When I have time, I'll hack AIO into the "raw" image driver, and take
> some benchmarks on a linux host.
Using aio would result in cleaner design in the end, but it would
require extra host specific code for the abstraction. It's also
non-buffered, which may or may not be a win for qemu (it should be,
would be trivial to test this with the existing code already).
For the normal case of a single or two block devices, performance of the
threaded vs libaio model will likely be the same. For many block
devices, libaio would definitely be a big improvement.
At least on Linux, the posix aio model is not worth spending time on, as
it just relies on threading as well on the glibc side. Then you might as
well just keep the design you have now.
BTW, thanks for starting this work, it's sorely needed! A future
experiment would be to write a sata/scsi qemu driver so you could do
sane command queueing. Since file layout isn't always perfect, that
should further increase the io performance.
--
Jens Axboe
next prev parent reply other threads:[~2005-10-04 6:41 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-03 6:49 [Qemu-devel] [patch] non-blocking disk IO John Coiner
2005-10-03 7:09 ` Magnus Damm
2005-10-03 9:57 ` Elefterios Stamatogiannakis
2005-10-03 12:58 ` Christian MICHON
2005-10-04 7:17 ` John Coiner
2005-10-04 7:46 ` Christian MICHON
2005-10-04 8:52 ` Elefterios Stamatogiannakis
2005-10-04 9:35 ` Christian MICHON
2005-10-04 11:19 ` Christian MICHON
2005-10-04 12:22 ` Jens Axboe
2005-10-04 13:14 ` John Coiner
2005-10-04 13:20 ` Christian MICHON
2005-10-03 13:58 ` Jens Axboe
2005-10-03 22:29 ` John Coiner
2005-10-04 6:41 ` Jens Axboe [this message]
2005-10-04 1:35 ` Troy Benjegerdes
2005-10-04 3:25 ` John Coiner
2005-10-04 3:49 ` Henrik Nordstrom
2005-10-04 5:24 ` Troy Benjegerdes
2005-10-04 6:44 ` Jens Axboe
2005-10-03 18:33 ` Fabrice Bellard
2005-10-04 20:40 ` Brad Campbell
2005-10-04 23:03 ` John Coiner
2005-10-05 11:27 ` Brad Campbell
2005-10-05 14:28 ` Troy Benjegerdes
2005-11-28 22:41 ` Ryan Rempel
-- strict thread matches above, loose matches on Subject: below --
2005-10-03 12:41 John Coiner
2005-10-04 1:34 ` Troy Benjegerdes
2005-10-04 3:16 ` John Coiner
2005-10-04 14:26 ` Troy Benjegerdes
2005-10-04 22:11 ` John Coiner
2005-10-05 3:17 ` Troy Benjegerdes
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=20051004064127.GE3511@suse.de \
--to=qemu@kernel.dk \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).