public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@kernel.org>
To: kvm@vger.kernel.org
Cc: Pekka Enberg <penberg@kernel.org>,
	Asias He <asias.hejun@gmail.com>,
	Cyrill Gorcunov <gorcunov@gmail.com>, Ingo Molnar <mingo@elte.hu>,
	Prasad Joshi <prasadjoshi124@gmail.com>,
	Sasha Levin <levinsasha928@gmail.com>
Subject: [PATCH 0/9] kvm tools, qcow: Improve QCOW performance
Date: Sat,  9 Jul 2011 16:02:33 +0300	[thread overview]
Message-ID: <1310216563-17503-1-git-send-email-penberg@kernel.org> (raw)

This series fixes QCOW locking issues and implements delayed metadata writeout.
This improves performance of writeout to QCOW2 images that don't have clusters
and L2 tables allocated on-disk.

I tested the series by running 

  mount -t ext4 /dev/vdb /mnt
  dd if=/dev/zero of=/mnt/tmp

in the guest multiple times for fresly generated QCOW2 image:

  dd if=/dev/zero of=fs.ext4 bs=1024k count=512 && mkfs.ext4 -F fs.ext4 && qemu-img convert -O qcow2 fs.ext4 fs.qcow2

which causes worst-case behavior for the current code.

Before:

  [ seekwatcher: http://userweb.kernel.org/~penberg/kvm-qcow-delayed/kvm-qcow2-master.png ]

  511229952 bytes (511 MB) copied, 19.906 s, 25.7 MB/s
  511229952 bytes (511 MB) copied, 20.3168 s, 25.2 MB/s
  511229952 bytes (511 MB) copied, 20.8078 s, 24.6 MB/s
  511229952 bytes (511 MB) copied, 21.0889 s, 24.2 MB/s
  511229952 bytes (511 MB) copied, 20.7833 s, 24.6 MB/s
  511229952 bytes (511 MB) copied, 20.7536 s, 24.6 MB/s
  511229952 bytes (511 MB) copied, 20.0312 s, 25.5 MB/s

After:

  [ seekwatcher: http://userweb.kernel.org/~penberg/kvm-qcow-delayed/kvm-qcow2-delayed.png ]

  511229952 bytes (511 MB) copied, 7.68312 s, 66.5 MB/s
  511229952 bytes (511 MB) copied, 7.54065 s, 67.8 MB/s
  511229952 bytes (511 MB) copied, 9.34749 s, 54.7 MB/s
  511229952 bytes (511 MB) copied, 9.2421 s, 55.3 MB/s
  511229952 bytes (511 MB) copied, 9.9364 s, 51.5 MB/s
  511229952 bytes (511 MB) copied, 10.0337 s, 51.0 MB/s
  511229952 bytes (511 MB) copied, 9.39502 s, 54.4 MB/s

For comparison, the results for raw ext4 images are as follows:

  [ seekwatcher: http://userweb.kernel.org/~penberg/kvm-qcow-delayed/kvm-raw.png ]

  511229952 bytes (511 MB) copied, 8.75403 s, 58.4 MB/s
  511229952 bytes (511 MB) copied, 10.3326 s, 49.5 MB/s
  511229952 bytes (511 MB) copied, 6.8494 s, 74.6 MB/s
  511229952 bytes (511 MB) copied, 9.21538 s, 55.5 MB/s
  511229952 bytes (511 MB) copied, 8.52883 s, 59.9 MB/s
  511229952 bytes (511 MB) copied, 8.13298 s, 62.9 MB/s
  511229952 bytes (511 MB) copied, 5.03801 s, 101 MB/s

			Pekka

Pekka Enberg (9):
  kvm tools, qcow: Rename struct qcow_l2_cache to struct qcow_l2_table
  kvm tools, qcow: Use 'struct qcow_l2_table' instead of untyped array
  kvm tools, qcow: Fix locking issues
  kvm tools, qcow: Introduce qcow_disk_flush()
  kvm tools, qcow: Delayed L1 table writeout
  kvm tools, qcow: Don't fdatasync() L2 table writeout
  kvm tools, qcow: Use big endian order for L2 table entries
  kvm tools, qcow: Delayed L2 table writeout
  kvm tools, qcow: Flush only dirty L2 tables

 tools/kvm/disk/qcow.c         |  248 ++++++++++++++++++++++-------------------
 tools/kvm/include/kvm/mutex.h |    6 +
 tools/kvm/include/kvm/qcow.h  |    6 +-
 3 files changed, 145 insertions(+), 115 deletions(-)


             reply	other threads:[~2011-07-09 13:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-09 13:02 Pekka Enberg [this message]
2011-07-09 13:02 ` [PATCH 1/9] kvm tools, qcow: Rename struct qcow_l2_cache to struct qcow_l2_table Pekka Enberg
2011-07-09 13:02 ` [PATCH 2/9] kvm tools, qcow: Use 'struct qcow_l2_table' instead of untyped array Pekka Enberg
2011-07-09 13:02 ` [PATCH 3/9] kvm tools, qcow: Fix locking issues Pekka Enberg
2011-07-09 13:02 ` [PATCH 4/9] kvm tools, qcow: Introduce qcow_disk_flush() Pekka Enberg
2011-07-09 13:02 ` [PATCH 5/9] kvm tools, qcow: Delayed L1 table writeout Pekka Enberg
2011-07-09 13:02 ` [PATCH 6/9] kvm tools, qcow: Don't fdatasync() L2 " Pekka Enberg
2011-07-09 13:02 ` [PATCH 7/9] kvm tools, qcow: Use big endian order for L2 table entries Pekka Enberg
2011-07-09 13:02 ` [PATCH 8/9] kvm tools, qcow: Delayed L2 table writeout Pekka Enberg
2011-07-09 13:02 ` [PATCH 9/9] kvm tools, qcow: Flush only dirty L2 tables Pekka Enberg
2011-07-10 17:15 ` [PATCH 0/9] kvm tools, qcow: Improve QCOW performance Ingo Molnar
2011-07-10 18:08   ` Pekka Enberg
2011-07-10 18:17     ` Ingo Molnar
2011-07-10 18:38       ` Pekka Enberg
2011-07-11  9:31     ` Kevin Wolf
2011-07-11  9:41       ` Pekka Enberg
2011-07-11 10:29         ` Kevin Wolf
2011-07-11 10:32           ` Pekka Enberg
2011-07-11 10:36         ` Ingo Molnar
2011-07-11 10:44           ` Pekka Enberg

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=1310216563-17503-1-git-send-email-penberg@kernel.org \
    --to=penberg@kernel.org \
    --cc=asias.hejun@gmail.com \
    --cc=gorcunov@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=levinsasha928@gmail.com \
    --cc=mingo@elte.hu \
    --cc=prasadjoshi124@gmail.com \
    /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