Skip to content

qcow2 metadata cache

Kevin Wolf qemu-devel 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest3 patches 3 repliesIn review
  2. v43 patches 7 repliesSuperseded
  3. v33 patches 0 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v23 patches0 repliesSuperseded
v12 patches0 repliesSuperseded

Changes in v5 from the cover letter

- Fixed return value of alloc_refcount_block
- Removed unnecessary bdrv_flush

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3qcow2: Add QcowCacheMakefile.objs block/qcow2-cache.c block/qcow2.h+310 -10 replies
2/3qcow2: Use QcowCacheblock/qcow2-cache.c block/qcow2-cluster.c block/qcow2-refcount.c +2 more+240 -2980 replies
3/3qcow2: Batch flushes for COWblock/qcow2-cache.c block/qcow2-cluster.c block/qcow2.h+19 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [Qemu-devel] [PATCH v5 0/3] qcow2 metadata cache

block-queue turned out to be too big effort to be useful for quickly fixing the performance problems that qcow2 got since we introduced the metadata flushes. While I still think the idea is right, it needs more time and qcow2 doesn't have more time. Let's come back to block-queue later when the most urgent qcow2 problems are fixed.

So this is the idea of block-queue applied to the very specific case of qcow2. Whereas block-queue tried to be a generic solution for all kind of things and tried to make all writes asynchronous at the same time, this is only about batching writes to refcount blocks and L2 tables in qcow2 and getting the dependencies right. (Yes, the L1 table and refcount table is left alone. They are almost never written to anyway.)

This should be much easier to understand and review, and I myself feel a bit more confident about it than with block-queue, too.

v1:
- Don't read newly allocated tables from the disk before memsetting them to zero

v2:
- Addressed Stefan's review comments
- Added patch 3 to avoid an unnecessary bdrv_flush after COW

v3:
- Some error path fixes (esp. missing or double qcow2_cache_put)

v4:
- Pay attention to make writethrough performance not even worse in update_refcount
- Add some blkdebug events back so that "failures" in qemu-iotests are kept minimal. Some diff between master and this series is left in test 026, but it's harmless.

v5:
- Fixed return value of alloc_refcount_block
- Removed unnecessary bdrv_flush

Kevin Wolf (3):
qcow2: Add QcowCache
qcow2: Use QcowCache
qcow2: Batch flushes for COW

 Makefile.objs          |    2 +-
 block/qcow2-cache.c    |  314 ++++++++++++++++++++++++++++++++++++++++++++++++
 block/qcow2-cluster.c  |  208 +++++++++++---------------------
 block/qcow2-refcount.c |  260 ++++++++++++++++-----------------------
 block/qcow2.c          |   48 +++++++-
 block/qcow2.h          |   32 ++++-
 6 files changed, 565 insertions(+), 299 deletions(-)
 create mode 100644 block/qcow2-cache.c
Signature · 1 line
1.7.2.3