From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=41571 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBat8-0004OS-AQ for qemu-devel@nongnu.org; Mon, 10 May 2010 17:51:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OBasz-0005jZ-V6 for qemu-devel@nongnu.org; Mon, 10 May 2010 17:51:45 -0400 Received: from cantor2.suse.de ([195.135.220.15]:38832 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBasz-0005jB-Oy for qemu-devel@nongnu.org; Mon, 10 May 2010 17:51:37 -0400 From: Alexander Graf Date: Mon, 10 May 2010 23:51:48 +0200 Message-Id: <1273528310-7051-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH 0/2] Enable qemu block layer to not flush List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, hch@lst.de 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(-)