[Qemu-devel] [PATCH v6 0/3] qcow2: add zstd cluster compression

Denis Plotnikov posted 3 patches 4 years, 7 months ago
Test docker-clang@ubuntu failed
Test FreeBSD passed
Test checkpatch passed
Test docker-mingw@fedora passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190905093109.12261-1-dplotnikov@virtuozzo.com
Maintainers: Max Reitz <mreitz@redhat.com>, Markus Armbruster <armbru@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Eric Blake <eblake@redhat.com>
There is a newer version of this series
block/qcow2-threads.c     | 199 +++++++++++++++++++++++++++++++++++---
block/qcow2.c             |  98 +++++++++++++++++++
block/qcow2.h             |  26 +++--
configure                 |  29 ++++++
docs/interop/qcow2.txt    |  35 ++++++-
include/block/block_int.h |   1 +
qapi/block-core.json      |  23 ++++-
7 files changed, 387 insertions(+), 24 deletions(-)
[Qemu-devel] [PATCH v6 0/3] qcow2: add zstd cluster compression
Posted by Denis Plotnikov 4 years, 7 months ago
v6:
* fixed zstd compressed length storing/loading [Eric]
* fixed wording, spec section placement [Eric]

v5:
* type changed for compression_type at BDRVQcow2State [Kevin]
* fixed typos, grammar [Kevin]
* fixed default config zstd setting [Kevin]

v4:
* remove not feasible switch case [Vladimir]
* add sanity checks to zstd decompresssion [Vladimir]
* store zstd compressed length in big endian [Max, Kevin]

v3:
* relax the compression type setting requirement when
  the compression type is not zlib [Eric, Kevin]
* add compression type values to the spec [Eric]
* fix wording in the spec and descriptions [Eric]
* fix functions descriptions [Max]
* fix zstd (de)compression functions flaws [Max]
* fix zstd related parts of configure file [Max]
* rebased to v4.1.0-rc5 and chenged the series version aiming to 4.2

v2:
* relax the compression type setting restriction in the spec
* fix qcow2 header size checking
* fix error processing and messaging
* fix qcow2 image specific info reporting
* set Qcow2CompressionType zstd config dependant
* add zstd compressed cluster format description to the spec

v1:
* extend qcow2 header instead of adding a new incompatible extension header
specification re-written accordingly
* enable zstd compression via config
* fix zstd (de)compression functions
* fix comments/description
* fix function naming

---
The goal of the patch-set is to enable qcow2 to use zstd compression for
clusters. ZSTD provides better (de)compression performance than currently
used ZLIB. Using it will improve perforamnce (reduce compression time)
when the compressed clusters is used, e.g backup scenarios.

Also, the patch-set extends qcow2 specification by adding compression_type
feature. The feature enables adding ZSTD and another compression algorithms
in the future.

Here is some measurements ZSTD vs ZLIB:

The test:
Test compresses and decompresses qemu qcow2 image with just
installed rhel-7.6 guest.
Image cluster size: 64K. Image on disk size: 2.2G

The test was conducted with brd disk to reduce the influence
of disk subsystem to the test results.
The results is given in seconds.

compress cmd:
time ./qemu-img convert -O qcow2 -c -o compression_type=[zlib|zstd]
src.img [zlib|zstd]_compressed.img
decompress cmd
time ./qemu-img convert -O qcow2
[zlib|zstd]_compressed.img uncompressed.img


The results:
compression decompression
zlib zstd zlib zstd
------------------------------------------------------------
real 65.5 16.3 (-75 %) 1.9 1.6 (-16 %)
user 65.0 15.8 5.3 2.5
sys 3.3 0.2 2.0 2.0

Both ZLIB and ZSTD gave the same compression ratio: ~1.5
compressed image size in both cases: ~1.4G

Denis Plotnikov (3):
  qcow2: introduce compression type feature
  qcow2: rework the cluster compression routine
  qcow2: add zstd cluster compression

 block/qcow2-threads.c     | 199 +++++++++++++++++++++++++++++++++++---
 block/qcow2.c             |  98 +++++++++++++++++++
 block/qcow2.h             |  26 +++--
 configure                 |  29 ++++++
 docs/interop/qcow2.txt    |  35 ++++++-
 include/block/block_int.h |   1 +
 qapi/block-core.json      |  23 ++++-
 7 files changed, 387 insertions(+), 24 deletions(-)

-- 
2.17.0


Re: [Qemu-devel] [PATCH v6 0/3] qcow2: add zstd cluster compression
Posted by Denis Plotnikov 4 years, 7 months ago
ping!

On 05.09.2019 12:31, Denis Plotnikov wrote:
> v6:
> * fixed zstd compressed length storing/loading [Eric]
> * fixed wording, spec section placement [Eric]
>
> v5:
> * type changed for compression_type at BDRVQcow2State [Kevin]
> * fixed typos, grammar [Kevin]
> * fixed default config zstd setting [Kevin]
>
> v4:
> * remove not feasible switch case [Vladimir]
> * add sanity checks to zstd decompresssion [Vladimir]
> * store zstd compressed length in big endian [Max, Kevin]
>
> v3:
> * relax the compression type setting requirement when
>    the compression type is not zlib [Eric, Kevin]
> * add compression type values to the spec [Eric]
> * fix wording in the spec and descriptions [Eric]
> * fix functions descriptions [Max]
> * fix zstd (de)compression functions flaws [Max]
> * fix zstd related parts of configure file [Max]
> * rebased to v4.1.0-rc5 and chenged the series version aiming to 4.2
>
> v2:
> * relax the compression type setting restriction in the spec
> * fix qcow2 header size checking
> * fix error processing and messaging
> * fix qcow2 image specific info reporting
> * set Qcow2CompressionType zstd config dependant
> * add zstd compressed cluster format description to the spec
>
> v1:
> * extend qcow2 header instead of adding a new incompatible extension header
> specification re-written accordingly
> * enable zstd compression via config
> * fix zstd (de)compression functions
> * fix comments/description
> * fix function naming
>
> ---
> The goal of the patch-set is to enable qcow2 to use zstd compression for
> clusters. ZSTD provides better (de)compression performance than currently
> used ZLIB. Using it will improve perforamnce (reduce compression time)
> when the compressed clusters is used, e.g backup scenarios.
>
> Also, the patch-set extends qcow2 specification by adding compression_type
> feature. The feature enables adding ZSTD and another compression algorithms
> in the future.
>
> Here is some measurements ZSTD vs ZLIB:
>
> The test:
> Test compresses and decompresses qemu qcow2 image with just
> installed rhel-7.6 guest.
> Image cluster size: 64K. Image on disk size: 2.2G
>
> The test was conducted with brd disk to reduce the influence
> of disk subsystem to the test results.
> The results is given in seconds.
>
> compress cmd:
> time ./qemu-img convert -O qcow2 -c -o compression_type=[zlib|zstd]
> src.img [zlib|zstd]_compressed.img
> decompress cmd
> time ./qemu-img convert -O qcow2
> [zlib|zstd]_compressed.img uncompressed.img
>
>
> The results:
> compression decompression
> zlib zstd zlib zstd
> ------------------------------------------------------------
> real 65.5 16.3 (-75 %) 1.9 1.6 (-16 %)
> user 65.0 15.8 5.3 2.5
> sys 3.3 0.2 2.0 2.0
>
> Both ZLIB and ZSTD gave the same compression ratio: ~1.5
> compressed image size in both cases: ~1.4G
>
> Denis Plotnikov (3):
>    qcow2: introduce compression type feature
>    qcow2: rework the cluster compression routine
>    qcow2: add zstd cluster compression
>
>   block/qcow2-threads.c     | 199 +++++++++++++++++++++++++++++++++++---
>   block/qcow2.c             |  98 +++++++++++++++++++
>   block/qcow2.h             |  26 +++--
>   configure                 |  29 ++++++
>   docs/interop/qcow2.txt    |  35 ++++++-
>   include/block/block_int.h |   1 +
>   qapi/block-core.json      |  23 ++++-
>   7 files changed, 387 insertions(+), 24 deletions(-)
>

[Qemu-devel] [Ping] [PATCH v6 0/3] qcow2: add zstd cluster compression
Posted by Denis Plotnikov 4 years, 7 months ago
On 12.09.2019 11:46, Denis Plotnikov wrote:
> ping!
>
> On 05.09.2019 12:31, Denis Plotnikov wrote:
>> v6:
>> * fixed zstd compressed length storing/loading [Eric]
>> * fixed wording, spec section placement [Eric]
>>
>> v5:
>> * type changed for compression_type at BDRVQcow2State [Kevin]
>> * fixed typos, grammar [Kevin]
>> * fixed default config zstd setting [Kevin]
>>
>> v4:
>> * remove not feasible switch case [Vladimir]
>> * add sanity checks to zstd decompresssion [Vladimir]
>> * store zstd compressed length in big endian [Max, Kevin]
>>
>> v3:
>> * relax the compression type setting requirement when
>>     the compression type is not zlib [Eric, Kevin]
>> * add compression type values to the spec [Eric]
>> * fix wording in the spec and descriptions [Eric]
>> * fix functions descriptions [Max]
>> * fix zstd (de)compression functions flaws [Max]
>> * fix zstd related parts of configure file [Max]
>> * rebased to v4.1.0-rc5 and chenged the series version aiming to 4.2
>>
>> v2:
>> * relax the compression type setting restriction in the spec
>> * fix qcow2 header size checking
>> * fix error processing and messaging
>> * fix qcow2 image specific info reporting
>> * set Qcow2CompressionType zstd config dependant
>> * add zstd compressed cluster format description to the spec
>>
>> v1:
>> * extend qcow2 header instead of adding a new incompatible extension header
>> specification re-written accordingly
>> * enable zstd compression via config
>> * fix zstd (de)compression functions
>> * fix comments/description
>> * fix function naming
>>
>> ---
>> The goal of the patch-set is to enable qcow2 to use zstd compression for
>> clusters. ZSTD provides better (de)compression performance than currently
>> used ZLIB. Using it will improve perforamnce (reduce compression time)
>> when the compressed clusters is used, e.g backup scenarios.
>>
>> Also, the patch-set extends qcow2 specification by adding compression_type
>> feature. The feature enables adding ZSTD and another compression algorithms
>> in the future.
>>
>> Here is some measurements ZSTD vs ZLIB:
>>
>> The test:
>> Test compresses and decompresses qemu qcow2 image with just
>> installed rhel-7.6 guest.
>> Image cluster size: 64K. Image on disk size: 2.2G
>>
>> The test was conducted with brd disk to reduce the influence
>> of disk subsystem to the test results.
>> The results is given in seconds.
>>
>> compress cmd:
>> time ./qemu-img convert -O qcow2 -c -o compression_type=[zlib|zstd]
>> src.img [zlib|zstd]_compressed.img
>> decompress cmd
>> time ./qemu-img convert -O qcow2
>> [zlib|zstd]_compressed.img uncompressed.img
>>
>>
>> The results:
>> compression decompression
>> zlib zstd zlib zstd
>> ------------------------------------------------------------
>> real 65.5 16.3 (-75 %) 1.9 1.6 (-16 %)
>> user 65.0 15.8 5.3 2.5
>> sys 3.3 0.2 2.0 2.0
>>
>> Both ZLIB and ZSTD gave the same compression ratio: ~1.5
>> compressed image size in both cases: ~1.4G
>>
>> Denis Plotnikov (3):
>>     qcow2: introduce compression type feature
>>     qcow2: rework the cluster compression routine
>>     qcow2: add zstd cluster compression
>>
>>    block/qcow2-threads.c     | 199 +++++++++++++++++++++++++++++++++++---
>>    block/qcow2.c             |  98 +++++++++++++++++++
>>    block/qcow2.h             |  26 +++--
>>    configure                 |  29 ++++++
>>    docs/interop/qcow2.txt    |  35 ++++++-
>>    include/block/block_int.h |   1 +
>>    qapi/block-core.json      |  23 ++++-
>>    7 files changed, 387 insertions(+), 24 deletions(-)
>>

Re: [Qemu-block] [Ping] [PATCH v6 0/3] qcow2: add zstd cluster compression
Posted by John Snow 4 years, 7 months ago

On 9/18/19 12:29 PM, Denis Plotnikov wrote:
> On 12.09.2019 11:46, Denis Plotnikov wrote:
>> ping!
>>

https://lists.gnu.org/archive/html/qemu-devel/2019-09/msg00943.html

I was under the impression you were addressing feedback from Vladimir.

--js

Re: [Qemu-block] [Ping] [PATCH v6 0/3] qcow2: add zstd cluster compression
Posted by Denis Plotnikov 4 years, 7 months ago
On 20.09.2019 20:55, John Snow wrote:
>
> On 9/18/19 12:29 PM, Denis Plotnikov wrote:
>> On 12.09.2019 11:46, Denis Plotnikov wrote:
>>> ping!
>>>
> https://lists.gnu.org/archive/html/qemu-devel/2019-09/msg00943.html
>
> I was under the impression you were addressing feedback from Vladimir.
>
> --js

I don't really know what to do with what Vladimir pointed out so I would 
like to get a feedback from Kevin and Eric about this.

Denis