qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/6] qcow2: flush caches in qcow2_alloc_bytes()


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH 3/6] qcow2: flush caches in qcow2_alloc_bytes()
Date: Wed, 20 Feb 2013 11:08:54 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Feb 19, 2013 at 04:45:03PM +0100, Stefan Hajnoczi wrote:
> It is not completely clear to me what is being flushed in
> qcow2_alloc_bytes() but bdrv_flush(bs->file) is probably wrong.  At
> least the refcount cache should be flushed since this function calls
> update_cluster_refcount().
> 
> To be on the safe side, call the full bdrv_flush(bs).  This flushes all
> caches and the underlying file itself.
> 
> Signed-off-by: Stefan Hajnoczi <address@hidden>

To me it looks as if qcow2_alloc_compressed_cluster_offset() would need
a call to qcow2_cache_set_dependency() like there is already for the
uncompressed case in qcow2_alloc_cluster_link_l2(). Once we have that,
the unconditional flush can be removed. I guess this will be a major
performance improvement for converting to compressed qcow2.

The bdrv_flush() ended up here only because I pushed the flush from
qcow2_alloc_clusters() to its callers so I could remove it from the
common fast path. All surviving instances from this still need review.

Kevin



reply via email to

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