qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 0/8] block/qcow2: Improve (?) zero cluster expansion


From: Max Reitz
Subject: [Qemu-devel] [PATCH 0/8] block/qcow2: Improve (?) zero cluster expansion
Date: Fri, 25 Jul 2014 20:07:37 +0200

The main purpose of this series is to add a progress report to
qemu-img amend. This is achieved by adding a callback function to
bdrv_amend_options() - the reasons for this choice are explained in
patch 1.

While adapting qcow2's expand_zero_clusters_in_l1() accordingly, I
noticed a way to simplify it and get rid of the rather ugly bitmap used
there (patch 6) and even found a way to optimize it (patch 7).

However, Kevin already expressed strong dislike about that patch 7, as
it complicates things in a function which should rarely ever be used.

I personally don't have a strong opinion on the topic. The optimization
should significantly increase the expansion performance; on the other
hand, it makes the code equally more complicated.

Patch 8 does not really depend on patch 7; it contains a test case
specifically for patch 7, but of course it works without that patch just
as well.

Therefore, we can simply drop patch 7 if we don't need it.


In this version, the total size of the "zero cluster expansion job" is
the number of zero cluster entries in all L2 tables multiplied by the
cluster size. This of course requires that number to be calculated
beforehand, which is complicated as well. An easier way (suggested by
Kevin) would be to simply use the number of all L2 entries as a basis.
This would not be as exact, but much easier to implement.

Since I already implemented the more complicated version of everything,
I'm just sending it as-is. I'll write an alternative to patch 5 which
uses the simpler variant and send it for comparison later.


This series depends on v2 of my "qemu-img: Allow source cache mode
specification" seires.


Max Reitz (8):
  block: Add status callback to bdrv_amend_options()
  qemu-img: Add progress output for amend
  qemu-img: Fix insignifcant memleak
  block/qcow2: Make get_refcount() global
  block/qcow2: Implement status CB for amend
  block/qcow2: Simplify shared L2 handling in amend
  block/qcow2: Speed up zero cluster expansion
  iotests: Expand test 061

 block.c                    |   5 +-
 block/qcow2-cluster.c      | 319 ++++++++++++++++++++++++++++++++++-----------
 block/qcow2-refcount.c     |  23 ++--
 block/qcow2.c              |  10 +-
 block/qcow2.h              |   5 +-
 include/block/block.h      |   5 +-
 include/block/block_int.h  |   3 +-
 qemu-img.c                 |  30 ++++-
 tests/qemu-iotests/061     |  41 ++++++
 tests/qemu-iotests/061.out |  40 ++++++
 tests/qemu-iotests/group   |   2 +-
 11 files changed, 379 insertions(+), 104 deletions(-)

-- 
2.0.1




reply via email to

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