qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [RFC 0/7] qcow2: implement lazy refcounts optimization


From: Stefan Hajnoczi
Subject: [Qemu-devel] [RFC 0/7] qcow2: implement lazy refcounts optimization
Date: Fri, 22 Jun 2012 16:08:39 +0100

This series aims to improve qcow2 performance with cache=writethrough and
cache=directsync.  In particular it reduces the impact of metadata updates for
allocating writes.

Allocating writes are expensive because they involve updating L2 tables and
refcount blocks.  In addition they can also cause L2 table allocation and
refcount block allocation but these remain unaffected by this optimization.

The key insight is that refcounts are not required to access data in the image.
This means that we can postpone refcount updates without violating the data
integrity guarantee that cache=writethrough and cache=directsync give.

The trade-off for postponing refcount updates is that the image may not be
completely consistent in case of power failure or crash.  If the image is dirty
then it must be repaired before performing further modifications, in other
words we need an fsck-like scan on startup.

I don't have performance results to share yet but I wanted to get the code out
there.  The bigger picture is that this optimization should help make qcow2 a
good choice even for cache=writethrough and cache=directsync where QED has
traditionally had an advantage due to less metadata - this allows us to
converge image format development in QEMU around the qcow2v3 format.

Stefan Hajnoczi (7):
  docs: add dirty bit to qcow2 specification
  qcow2: introduce dirty bit
  docs: add lazy refcounts bit to qcow2 specification
  qemu-iotests: ignore qemu-img create lazy_refcounts output
  qcow2: implement lazy refcounts
  qemu-io: add "abort" command to simulate program crash
  qemu-iotests: add 039 qcow2 lazy refcounts test

 block/qcow2-cluster.c        |    5 +-
 block/qcow2.c                |  111 +++++++++++++++++++++++++++++++++++++++---
 block/qcow2.h                |   11 +++++
 block_int.h                  |   26 +++++-----
 docs/specs/qcow2.txt         |   12 ++++-
 qemu-io.c                    |   12 +++++
 tests/qemu-iotests/039       |   99 +++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/039.out   |   34 +++++++++++++
 tests/qemu-iotests/common.rc |    3 +-
 tests/qemu-iotests/group     |    1 +
 10 files changed, 292 insertions(+), 22 deletions(-)
 create mode 100755 tests/qemu-iotests/039
 create mode 100644 tests/qemu-iotests/039.out

-- 
1.7.10




reply via email to

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