[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 0/2] Enable qemu block layer to not flush

From: Alexander Graf
Subject: [Qemu-devel] [PATCH 0/2] Enable qemu block layer to not flush
Date: Mon, 10 May 2010 23:51:48 +0200

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]