From: Alexander Graf <agraf@suse.de>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, hch@lst.de
Subject: [Qemu-devel] [PATCH 0/2] Enable qemu block layer to not flush v2
Date: Thu, 13 May 2010 01:36:26 +0200 [thread overview]
Message-ID: <1273707388-5213-1-git-send-email-agraf@suse.de> (raw)
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(-)
next reply other threads:[~2010-05-13 3:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-12 23:36 Alexander Graf [this message]
2010-05-12 23:36 ` [Qemu-devel] [PATCH 1/2] Add no-op aio emulation stub Alexander Graf
2010-05-12 23:36 ` [Qemu-devel] [PATCH 2/2] Add cache=volatile parameter to -drive Alexander Graf
2010-05-14 13:12 ` [Qemu-devel] Re: [PATCH 1/2] Add no-op aio emulation stub Kevin Wolf
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=1273707388-5213-1-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=hch@lst.de \
--cc=kwolf@redhat.com \
--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).