qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC 2/2] bdrv_aio_readv/writev_em
Date: Fri, 28 Nov 2008 11:09:25 +0000	[thread overview]
Message-ID: <20081128110924.GE6138@shareable.org> (raw)
In-Reply-To: <20081127124351.GD10348@random.random>

Andrea Arcangeli wrote:
> pthread_create() and do aio with pthreads by calling writev by hand.
> 
> Use kernel based linux aio (I think it's much better as it won't
> screwup with contiguous I/O, and it handles o_direct random writes and
> random reads by keeping the lowlevel I/O pipeline full without threads
> but by just queuing _in_order_ [in order only from the point of view
> of the I/O scheduler of course] and asynchronously the commands of
> every different direct-io aio_readv/writev in the lowlevel storage
> queue without needing any scheduler and thread synchronization
> involvement).

The good things about linux-aio are as you described.

The bad thing is that I'm told linux-aio can block sometimes.  Apart
from memory pressure (which can block the calling process anyway), an
aio implementation which can block is not so good.

Doing it in a pthread is less good for a lot of reasons.  On the other
hand, I/O in a pthread should never block the main thread.  We
discussed the "in order" part a while ago, and several people pointed
out that once there are a few I/Os in flight, the order should
stabilise automatically, but perhaps that's not so good in transient
situations.

(Ideally we'd use scheduler activations (syslets!) to avoid blocking
in any kernel I/O path no matter how complex, while keeping aio
ordering and avoiding unnecessary task switching.  I haven't heard
much about progress on this since earlier this year...)

-- Jamie

  reply	other threads:[~2008-11-28 11:09 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-27 12:35 [Qemu-devel] [RFC 1/2] pci-dma-api-v1 Andrea Arcangeli
2008-11-27 12:43 ` [Qemu-devel] [RFC 2/2] bdrv_aio_readv/writev_em Andrea Arcangeli
2008-11-28 11:09   ` Jamie Lokier [this message]
2008-11-27 19:14 ` [Qemu-devel] [RFC 1/2] pci-dma-api-v1 Blue Swirl
2008-11-28  1:56   ` Andrea Arcangeli
2008-11-28 17:59     ` Blue Swirl
2008-11-28 18:50       ` Andrea Arcangeli
2008-11-28 19:03         ` Blue Swirl
2008-11-28 19:18           ` Jamie Lokier
2008-11-29 19:49             ` Avi Kivity
2008-11-30 17:20             ` Andrea Arcangeli
2008-11-30 22:31             ` Anthony Liguori
2008-11-30 18:04           ` Andrea Arcangeli
2008-11-30 17:41         ` [Qemu-devel] [RFC 1/1] pci-dma-api-v2 Andrea Arcangeli
2008-11-30 18:36           ` [Qemu-devel] " Blue Swirl
2008-11-30 19:04             ` Andrea Arcangeli
2008-11-30 19:11               ` Blue Swirl
2008-11-30 19:20                 ` Andrea Arcangeli
2008-11-30 21:36                   ` Blue Swirl
2008-11-30 22:54                     ` Anthony Liguori
2008-11-30 22:50           ` [Qemu-devel] " Anthony Liguori
2008-12-01  9:41             ` Avi Kivity
2008-12-01 16:37               ` Anthony Liguori
2008-12-02  9:45                 ` Avi Kivity
2008-11-30 22:38         ` [Qemu-devel] [RFC 1/2] pci-dma-api-v1 Anthony Liguori
2008-11-30 22:51           ` Jamie Lokier
2008-11-30 22:34       ` Anthony Liguori
2008-11-29 19:48   ` Avi Kivity
2008-11-30 17:29     ` Andrea Arcangeli
2008-11-30 20:27       ` Avi Kivity
2008-11-30 22:33         ` Andrea Arcangeli
2008-11-30 22:33   ` Anthony Liguori

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=20081128110924.GE6138@shareable.org \
    --to=jamie@shareable.org \
    --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).