From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sczib-0003HU-M7 for qemu-devel@nongnu.org; Fri, 08 Jun 2012 09:59:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ScziY-0007kX-Kj for qemu-devel@nongnu.org; Fri, 08 Jun 2012 09:59:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37246) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ScziY-0007kL-D5 for qemu-devel@nongnu.org; Fri, 08 Jun 2012 09:59:10 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q58Dx8n8006293 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 8 Jun 2012 09:59:08 -0400 Message-ID: <4FD20529.5000701@redhat.com> Date: Fri, 08 Jun 2012 15:59:05 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1338933895-20677-1-git-send-email-pbonzini@redhat.com> <1338933895-20677-8-git-send-email-pbonzini@redhat.com> In-Reply-To: <1338933895-20677-8-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 7/7] qcow2: always operate caches in writeback mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org Am 06.06.2012 00:04, schrieb Paolo Bonzini: > Writethrough does not need special-casing anymore in the qcow2 caches. > The block layer adds flushes after every guest-initiated data write, > and these will also flush the qcow2 caches to the OS. > > Signed-off-by: Paolo Bonzini > diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c > index 5d6ea72..66f3915 100644 > --- a/block/qcow2-refcount.c > +++ b/block/qcow2-refcount.c > @@ -726,13 +726,6 @@ int qcow2_update_snapshot_refcount(BlockDriverState *bs, > int64_t old_offset, old_l2_offset; > int i, j, l1_modified = 0, nb_csectors, refcount; > int ret; > - bool old_l2_writethrough, old_refcount_writethrough; > - > - /* Switch caches to writeback mode during update */ > - old_l2_writethrough = > - qcow2_cache_set_writethrough(bs, s->l2_table_cache, false); > - old_refcount_writethrough = > - qcow2_cache_set_writethrough(bs, s->refcount_block_cache, false); > > l2_table = NULL; > l1_table = NULL; > @@ -856,11 +849,6 @@ fail: > qcow2_cache_put(bs, s->l2_table_cache, (void**) &l2_table); > } > > - /* Enable writethrough cache mode again */ > - qcow2_cache_set_writethrough(bs, s->l2_table_cache, old_l2_writethrough); > - qcow2_cache_set_writethrough(bs, s->refcount_block_cache, > - old_refcount_writethrough); > - Here you're dropping an implicit cache flush. Not sure if it really matters, though. Maybe we should add flushes in the right places in higher level functions like bdrv_snapshot_create(). Kevin