From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M8vu8-0001iQ-Dz for qemu-devel@nongnu.org; Tue, 26 May 2009 08:37:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M8vu3-0001fh-SY for qemu-devel@nongnu.org; Tue, 26 May 2009 08:37:16 -0400 Received: from [199.232.76.173] (port=39060 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M8vu3-0001fb-Lr for qemu-devel@nongnu.org; Tue, 26 May 2009 08:37:11 -0400 Received: from mx2.redhat.com ([66.187.237.31]:53235) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M8vu3-0007WT-6x for qemu-devel@nongnu.org; Tue, 26 May 2009 08:37:11 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n4QCb8Pt031137 for ; Tue, 26 May 2009 08:37:08 -0400 From: Kevin Wolf Date: Tue, 26 May 2009 14:36:01 +0200 Message-Id: <1243341363-6507-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 0/2] qcow2: Update multiple refcounts at once List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf When updating the refcount of a range of cluste, qcow2 currently processes single clusters, so for each cluster there is a separate write to the dis image. This series changes this behaviour to change the refcount of all cluters in the same refcount block before writing anything to disk, saving some write operations. The influence of this change is highest when lots of large request frequently allocate multiple clusters at once - growing an empty image during FS creation or installation. The allocation itself is already optimized for this case, refcount updates are an important missing piece: I trief mke2fs on an empty image (cache=off) and it went down from 7:15 min to 1:59 min. Even with writeback caching we still gain a small percentage (with the right qemu-io test case even a huge one, but I guess this doesn't matter in practice). I'm fairly confident that this series is correct, it has passed the test scripts I have here and some manual testing. However, given the recent qcow2 history I don't feel completely comfortable with touching this part of qcow2, so please run this with all test cases you all have for it. And give it a thorough review, of course. Kevin Wolf (2): qcow2: Refactor update_refcount qcow2: Update multiple refcounts at once block/qcow2.c | 118 ++++++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 88 insertions(+), 30 deletions(-)