All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC][PATCH 00/12] qcow2: Convert qcow2 to use coroutines for async I/O
@ 2011-01-22  9:29 Stefan Hajnoczi
  2011-01-22  9:29 ` [Qemu-devel] [RFC][PATCH 01/12] coroutine: Add gtk-vnc coroutines library Stefan Hajnoczi
                   ` (13 more replies)
  0 siblings, 14 replies; 46+ messages in thread
From: Stefan Hajnoczi @ 2011-01-22  9:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Anthony Liguori

This patch series prototypes making QCOW2 fully asynchronous to eliminate the
timing jitter and poor performance that has been observed.  QCOW2 has
asynchronous I/O code paths for some of the read/write common cases but
metadata access is always synchronous.

One solution is to rewrite QCOW2 to be fully asynchronous by splitting all
functions that perform blocking I/O into a series of callbacks.  Due to the
complexity of QCOW2, this conversion and the maintenance prospects are
unattractive.

This patch series prototypes an alternative solution to make QCOW2
asynchronous.  It introduces coroutines, cooperative userspace threads of
control, so that each QCOW2 request has its own call stack.  To perform I/O,
the coroutine submits an asynchronous I/O request and then yields back to QEMU.
The coroutine stays suspended while the I/O operation is being processed by
lower layers of the stack.  When the asynchronous I/O completes, the coroutine
is resumed.

The upshot of this is that QCOW2 can be implemented in a sequential fashion
without explicit callbacks but all I/O actually happens asynchronously under
the covers.

This prototype implements reads, writes, and flushes.  Should install or boot
VMs successfully.  However, it has the following limitations:

1. QCOW2 requests are serialized because the code is not yet safe for
   concurrent requests.  See the last patch for details.

2. Coroutines are unoptimized.  We should pool coroutines (and their mmapped
   stacks) to avoid the cost of coroutine creation.

3. The qcow2_aio_read_cb() and qcow2_aoi_write_cb() functions should be
   refactored into sequential code now that callbacks are no longer needed.

I think this approach can solve the performance and functional problems of the
current QCOW2 implementation.  It does not require invasive changes, much of
QCOW2 works unmodified.

Kevin: Do you like this approach and do you want to develop it further?

Stefan

^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2011-02-01 13:22 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-22  9:29 [Qemu-devel] [RFC][PATCH 00/12] qcow2: Convert qcow2 to use coroutines for async I/O Stefan Hajnoczi
2011-01-22  9:29 ` [Qemu-devel] [RFC][PATCH 01/12] coroutine: Add gtk-vnc coroutines library Stefan Hajnoczi
2011-01-26 15:25   ` Avi Kivity
2011-01-26 16:00     ` Anthony Liguori
2011-01-26 16:13       ` Avi Kivity
2011-01-26 16:19         ` Anthony Liguori
2011-01-26 16:22           ` Avi Kivity
2011-01-26 16:29             ` Anthony Liguori
2011-01-26 16:21         ` Anthony Liguori
2011-01-22  9:29 ` [Qemu-devel] [RFC][PATCH 02/12] continuation: Fix container_of() redefinition Stefan Hajnoczi
2011-01-22  9:29 ` [Qemu-devel] [RFC][PATCH 03/12] Make sure to release allocated stack when coroutine is released Stefan Hajnoczi
2011-01-22  9:29 ` [Qemu-devel] [RFC][PATCH 04/12] coroutine: Use thread-local leader and current variables Stefan Hajnoczi
2011-01-22  9:29 ` [Qemu-devel] [RFC][PATCH 05/12] coroutine: Add coroutines Stefan Hajnoczi
2011-01-26 15:29   ` Avi Kivity
2011-01-26 16:00     ` Anthony Liguori
2011-01-27  9:40     ` Stefan Hajnoczi
2011-01-22  9:29 ` [Qemu-devel] [RFC][PATCH 06/12] coroutine: Add qemu_coroutine_self() Stefan Hajnoczi
2011-01-22  9:29 ` [Qemu-devel] [RFC][PATCH 07/12] coroutine: Add coroutine_is_leader() Stefan Hajnoczi
2011-01-22  9:29 ` [Qemu-devel] [RFC][PATCH 08/12] coroutine: Add qemu_in_coroutine() Stefan Hajnoczi
2011-01-22  9:29 ` [Qemu-devel] [RFC][PATCH 09/12] block: Add bdrv_co_readv() and bdrv_co_writev() Stefan Hajnoczi
2011-01-22  9:29 ` [Qemu-devel] [RFC][PATCH 10/12] block: Add coroutine support to synchronous I/O functions Stefan Hajnoczi
2011-01-22  9:29 ` [Qemu-devel] [RFC][PATCH 11/12] qcow2: Convert qcow2 to use coroutines for async I/O Stefan Hajnoczi
2011-01-23 23:40   ` Anthony Liguori
2011-01-24 11:09     ` Stefan Hajnoczi
2011-01-26 15:40   ` Avi Kivity
2011-01-26 15:50     ` Kevin Wolf
2011-01-26 16:08       ` Anthony Liguori
2011-01-26 16:13         ` Avi Kivity
2011-01-26 16:28           ` Anthony Liguori
2011-01-26 16:38             ` Avi Kivity
2011-01-26 17:12               ` Anthony Liguori
2011-01-27  9:25                 ` Avi Kivity
2011-01-27  9:27                 ` Kevin Wolf
2011-01-27  9:49                   ` Avi Kivity
2011-01-27 10:34                     ` Kevin Wolf
2011-01-27 10:41                       ` Avi Kivity
2011-01-27 11:27                         ` Kevin Wolf
2011-01-27 12:21                           ` Avi Kivity
2011-01-26 16:08       ` Avi Kivity
2011-01-27 10:09     ` Stefan Hajnoczi
2011-01-27 10:46       ` Avi Kivity
2011-01-22  9:29 ` [Qemu-devel] [RFC][PATCH 12/12] qcow2: Serialize all requests Stefan Hajnoczi
2011-01-23 23:31 ` [Qemu-devel] [RFC][PATCH 00/12] qcow2: Convert qcow2 to use coroutines for async I/O Anthony Liguori
2011-02-01 13:23   ` Kevin Wolf
2011-01-24 11:58 ` [Qemu-devel] " Kevin Wolf
2011-01-24 13:10   ` Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.