qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] Enable qemu block layer to not flush
@ 2010-05-10 21:51 Alexander Graf
  2010-05-10 21:51 ` [Qemu-devel] [PATCH 1/2] Add no-op aio emulation stub Alexander Graf
  2010-05-10 21:59 ` [Qemu-devel] [PATCH 0/2] Enable qemu block layer to not flush Anthony Liguori
  0 siblings, 2 replies; 42+ messages in thread
From: Alexander Graf @ 2010-05-10 21:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, hch

Thanks to recent improvements, qemu flushes guest data to disk when the guest
tells us to do so.

This is great if we care about data consistency on host disk failures. In cases
where we don't it just creates additional overhead for no net win. One such use
case is the building of appliances in SUSE Studio. We write the resulting images
out of the build VM, but compress it directly afterwards. So if possible we'd
love to keep it in RAM.

This patchset introduces a new block parameter to -drive called "flush" which
allows a user to disable flushing in odd scenarios like the above. To show the
difference in performance this makes, I have put together a small test case.
Inside the initrd, I call the following piece of code on a 500MB preallocated
vmdk image:

  mkfs.ext3 /dev/vda
  mkdir -p /mnt
  mount /dev/vda /mnt
  dd if=/dev/zero of=/mnt/test bs=1M
  umount /mnt
  sync
  halt -fp

With flush=on (default)

real	0m33.597s
user	0m16.453s
sys	0m6.192s

With flush=off

real	0m27.150s
user	0m16.533s
sys	0m5.348s


Alexander Graf (2):
  Add no-op aio emulation stub
  Add flush=off parameter to -drive

 block.c           |   18 ++++++++++++++++++
 block.h           |    5 +++++
 block/raw-posix.c |   13 +++++++++++++
 qemu-config.c     |    3 +++
 qemu-options.hx   |    3 +++
 vl.c              |    3 +++
 6 files changed, 45 insertions(+), 0 deletions(-)

^ permalink raw reply	[flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 0/2] Enable qemu block layer to not flush v2
@ 2010-05-12 23:36 Alexander Graf
  2010-05-12 23:36 ` [Qemu-devel] [PATCH 1/2] Add no-op aio emulation stub Alexander Graf
  0 siblings, 1 reply; 42+ messages in thread
From: Alexander Graf @ 2010-05-12 23:36 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, hch

Thanks to recent improvements, qemu flushes guest data to disk when the guest
tells us to do so.

This is great if we care about data consistency on host disk failures. In cases
where we don't it just creates additional overhead for no net win. One such use
case is the building of appliances in SUSE Studio. We write the resulting images
out of the build VM, but compress it directly afterwards. So if possible we'd
love to keep it in RAM.

This patchset introduces a new cache option to -drive called "volatile" which
allows a user to signal qemu that he doesn't care about data integrity.
To show the difference in performance this makes, I have put together a small
test case. Inside the initrd, I call the following piece of code on a 500MB
preallocated vmdk image:

  mkfs.ext3 /dev/vda
  mkdir -p /mnt
  mount /dev/vda /mnt
  dd if=/dev/zero of=/mnt/test bs=1M
  umount /mnt
  sync
  halt -fp

With cache=writeback

real	0m34.653s
user	0m16.957s
sys	0m5.872s

With cache=volatile

real	0m27.068s
user	0m15.829s
sys	0m6.648s

When I use a loopback file with msdos format and put the vmdk inside there,
performance for cache=writeback and cache=volatile is basically identical.

It nevertheless does make sense to offer a cache=volatile option to the user,
as it's not always possible to loopback mount your own file systems, especially
given qemu's non-root nature.

v1 -> v2:

  - clean up no_op patch
  - move to cache=volatile instead of flush=off
  - make code less intrusive by catching everything in block.c

Alexander Graf (2):
  Add no-op aio emulation stub
  Add cache=volatile parameter to -drive

 block.c         |   28 ++++++++++++++++++++++++++++
 block.h         |    1 +
 qemu-config.c   |    2 +-
 qemu-options.hx |    7 ++++---
 vl.c            |    3 +++
 5 files changed, 37 insertions(+), 4 deletions(-)

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

end of thread, other threads:[~2010-05-17 12:42 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-10 21:51 [Qemu-devel] [PATCH 0/2] Enable qemu block layer to not flush Alexander Graf
2010-05-10 21:51 ` [Qemu-devel] [PATCH 1/2] Add no-op aio emulation stub Alexander Graf
2010-05-10 21:51   ` [Qemu-devel] [PATCH 2/2] Add flush=off parameter to -drive Alexander Graf
2010-05-11  8:36     ` [Qemu-devel] " Kevin Wolf
2010-05-11 10:55       ` Christoph Hellwig
2010-05-11 12:15         ` Paul Brook
2010-05-11 12:43           ` Anthony Liguori
2010-05-11 13:12             ` Paul Brook
2010-05-11 13:20               ` Anthony Liguori
2010-05-11 13:50                 ` Paul Brook
2010-05-11 15:40                   ` Anthony Liguori
2010-05-11 15:53                     ` Paul Brook
2010-05-11 17:09                       ` Anthony Liguori
2010-05-11 22:33                         ` Paul Brook
2010-05-11 19:11                     ` Avi Kivity
2010-05-11 16:32                 ` Jamie Lokier
2010-05-11 17:15                   ` Anthony Liguori
2010-05-11 18:13                     ` Jamie Lokier
2010-05-11 15:18           ` Alexander Graf
2010-05-11 18:20           ` Jamie Lokier
2010-05-11 21:58             ` Paul Brook
2010-05-11 22:11               ` Paul Brook
2010-05-12 10:09                 ` Jamie Lokier
2010-05-17 12:40                 ` Christoph Hellwig
2010-05-14  9:16         ` Markus Armbruster
2010-05-17 12:41           ` Christoph Hellwig
2010-05-17 12:42             ` Alexander Graf
2010-05-11 19:04       ` Avi Kivity
2010-05-12 15:05       ` Alexander Graf
2010-05-12 15:36         ` Kevin Wolf
2010-05-12 15:51           ` Alexander Graf
2010-05-11  6:18   ` [Qemu-devel] [PATCH 1/2] Add no-op aio emulation stub Stefan Hajnoczi
2010-05-11  8:29   ` [Qemu-devel] " Kevin Wolf
2010-05-10 21:59 ` [Qemu-devel] [PATCH 0/2] Enable qemu block layer to not flush Anthony Liguori
2010-05-10 22:03   ` Alexander Graf
2010-05-10 22:12     ` Anthony Liguori
2010-05-11 21:48       ` Jamie Lokier
2010-05-12  8:51         ` Stefan Hajnoczi
2010-05-12  9:42           ` Jamie Lokier
2010-05-12 10:43             ` Stefan Hajnoczi
2010-05-12 12:50               ` Jamie Lokier
  -- strict thread matches above, loose matches on Subject: below --
2010-05-12 23:36 [Qemu-devel] [PATCH 0/2] Enable qemu block layer to not flush v2 Alexander Graf
2010-05-12 23:36 ` [Qemu-devel] [PATCH 1/2] Add no-op aio emulation stub Alexander Graf
2010-05-14 13:12   ` [Qemu-devel] " Kevin Wolf

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).