[Qemu-devel] [PATCH 0/7] qcow2 decompress in threads

Vladimir Sementsov-Ogievskiy posted 7 patches 5 years, 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20181101182738.70462-1-vsementsov@virtuozzo.com
Test docker-clang@ubuntu passed
Test checkpatch passed
Test asan passed
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
block/qcow2.h         |   4 -
block/qcow2-cluster.c |  70 -----------------
block/qcow2.c         | 169 +++++++++++++++++++++++++++++++++++-------
3 files changed, 143 insertions(+), 100 deletions(-)
[Qemu-devel] [PATCH 0/7] qcow2 decompress in threads
Posted by Vladimir Sementsov-Ogievskiy 5 years, 5 months ago
Hi all!

The series brings threads to qcow2 decompression path, like it is
already done for compression.

Performance gain is illustrated by the following test:

[]# cat gen.sh
#!/bin/bash

echo 'create pattern-file /ssd/t_pat'

./qemu-img create -f raw /ssd/t_pat 10g
for i in {0..9}; do
    ./qemu-io -f raw -c "write -P 0xab ${i}g 1g" /ssd/t_pat
done

echo 'convert it to compressed /ssd/t_pat.compressed.qcow2'

./qemu-img convert -W -f raw -O qcow2 -c /ssd/t_pat /ssd/t_pat.compressed.qcow2
rm -f /ssd/t_pat

test:
[]# time ./qemu-img convert -f qcow2 --target-image-opts -n /ssd/t_pat.compressed.qcow2  'driver=null-co,size=10G'



result before the series:

real    0m16.585s
user    0m14.899s
sys     0m2.219s



result after the series:

real    0m6.528s
user    0m19.343s
sys     0m3.081s


Note: my cpu is 4-cores 8-threads i7-4790

Vladimir Sementsov-Ogievskiy (7):
  qcow2: use Z_OK instead of 0 for deflateInit2 return code check
  qcow2: make more generic interface for qcow2_compress
  qcow2: move decompression from qcow2-cluster.c to qcow2.c
  qcow2: refactor decompress_buffer
  qcow2: use byte-based read in qcow2_decompress_cluster
  qcow2: aio support for compressed cluster read
  qcow2: do decompression in threads

 block/qcow2.h         |   4 -
 block/qcow2-cluster.c |  70 -----------------
 block/qcow2.c         | 169 +++++++++++++++++++++++++++++++++++-------
 3 files changed, 143 insertions(+), 100 deletions(-)

-- 
2.18.0


Re: [Qemu-devel] [PATCH 0/7] qcow2 decompress in threads
Posted by Kevin Wolf 5 years, 5 months ago
Am 01.11.2018 um 19:27 hat Vladimir Sementsov-Ogievskiy geschrieben:
> Hi all!
> 
> The series brings threads to qcow2 decompression path, like it is
> already done for compression.

Thanks! Nice series, I like it a lot.

I fixed some non-function stuff like the coroutine_fn tags and comment
formatting and applied it to block-next (for 3.2).

Kevin

Re: [Qemu-devel] [PATCH 0/7] qcow2 decompress in threads
Posted by Vladimir Sementsov-Ogievskiy 5 years, 5 months ago
12.11.2018 18:32, Kevin Wolf wrote:
> Am 01.11.2018 um 19:27 hat Vladimir Sementsov-Ogievskiy geschrieben:
>> Hi all!
>>
>> The series brings threads to qcow2 decompression path, like it is
>> already done for compression.
> 
> Thanks! Nice series, I like it a lot.

Thank you!

> 
> I fixed some non-function stuff like the coroutine_fn tags and comment
> formatting and applied it to block-next (for 3.2).
> 
> Kevin
> 


-- 
Best regards,
Vladimir