From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Si5Tu-0005Xg-L0 for qemu-devel@nongnu.org; Fri, 22 Jun 2012 11:09:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Si5Tp-0007sm-HQ for qemu-devel@nongnu.org; Fri, 22 Jun 2012 11:09:06 -0400 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:48326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Si5Tp-0007sT-8p for qemu-devel@nongnu.org; Fri, 22 Jun 2012 11:09:01 -0400 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 22 Jun 2012 16:08:56 +0100 Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q5MF8sSb2924610 for ; Fri, 22 Jun 2012 16:08:54 +0100 Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q5MEshPl005239 for ; Fri, 22 Jun 2012 10:54:43 -0400 From: Stefan Hajnoczi Date: Fri, 22 Jun 2012 16:08:39 +0100 Message-Id: <1340377726-5896-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [RFC 0/7] qcow2: implement lazy refcounts optimization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, 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