qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC 0/7] qcow2: implement lazy refcounts optimization
@ 2012-06-22 15:08 Stefan Hajnoczi
  2012-06-22 15:08 ` [Qemu-devel] [RFC 1/7] docs: add dirty bit to qcow2 specification Stefan Hajnoczi
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Stefan Hajnoczi @ 2012-06-22 15:08 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel, Stefan Hajnoczi

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-06-22 15:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-22 15:08 [Qemu-devel] [RFC 0/7] qcow2: implement lazy refcounts optimization Stefan Hajnoczi
2012-06-22 15:08 ` [Qemu-devel] [RFC 1/7] docs: add dirty bit to qcow2 specification Stefan Hajnoczi
2012-06-22 15:08 ` [Qemu-devel] [RFC 2/7] qcow2: introduce dirty bit Stefan Hajnoczi
2012-06-22 15:08 ` [Qemu-devel] [RFC 3/7] docs: add lazy refcounts bit to qcow2 specification Stefan Hajnoczi
2012-06-22 15:08 ` [Qemu-devel] [RFC 4/7] qemu-iotests: ignore qemu-img create lazy_refcounts output Stefan Hajnoczi
2012-06-22 15:08 ` [Qemu-devel] [RFC 5/7] qcow2: implement lazy refcounts Stefan Hajnoczi
2012-06-22 15:08 ` [Qemu-devel] [RFC 6/7] qemu-io: add "abort" command to simulate program crash Stefan Hajnoczi
2012-06-22 15:08 ` [Qemu-devel] [RFC 7/7] qemu-iotests: add 039 qcow2 lazy refcounts test Stefan Hajnoczi

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