[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
- [Qemu-devel] [PATCH 0/6] qcow2: cache flush fixes and performance improvements, Stefan Hajnoczi, 2013/02/19
- [Qemu-devel] [PATCH 1/6] qcow2: flush refcount cache correctly in alloc_refcount_block(), Stefan Hajnoczi, 2013/02/19
- [Qemu-devel] [PATCH 4/6] qcow2: flush in qcow2_update_snapshot_refcount(), Stefan Hajnoczi, 2013/02/19
- [Qemu-devel] [PATCH 2/6] qcow2: flush refcount cache correctly in qcow2_write_snapshots(), Stefan Hajnoczi, 2013/02/19
- [Qemu-devel] [PATCH 5/6] qcow2: drop flush in update_cluster_refcount(), Stefan Hajnoczi, 2013/02/19
- [Qemu-devel] [PATCH 3/6] qcow2: flush caches in qcow2_alloc_bytes(), Stefan Hajnoczi, 2013/02/19
- Re: [Qemu-devel] [PATCH 3/6] qcow2: flush caches in qcow2_alloc_bytes(),
Kevin Wolf <=
- [Qemu-devel] [PATCH 6/6] qcow2: drop unnecessary flush in qcow2_update_snapshot_refcount(), Stefan Hajnoczi, 2013/02/19
- Re: [Qemu-devel] [PATCH 0/6] qcow2: cache flush fixes and performance improvements, Eric Blake, 2013/02/19
- Re: [Qemu-devel] [PATCH 0/6] qcow2: cache flush fixes and performance improvements, Kevin Wolf, 2013/02/20