#
6b422e5f |
| 04-Sep-2019 |
Peter Maydell <peter.maydell@linaro.org> |
Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2019-09-03' into staging
Block patches: - qemu-io now accepts a file to read a write pattern from - Ensure that raw files have their fi
Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2019-09-03' into staging
Block patches: - qemu-io now accepts a file to read a write pattern from - Ensure that raw files have their first block allocated so we can probe the O_DIRECT alignment if necessary - Various fixes
# gpg: Signature made Tue 03 Sep 2019 13:58:57 BST # gpg: using RSA key 91BEB60A30DB3E8857D11829F407DB0061D5CF40 # gpg: issuer "mreitz@redhat.com" # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" [full] # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1 1829 F407 DB00 61D5 CF40
* remotes/maxreitz/tags/pull-block-2019-09-03: iotests: Unify cache mode quoting tests/check-block: Skip iotests when sanitizers are enabled iotests: Check for enabled drivers before testing them iotests: Add -display none to the qemu options file-posix: fix request_alignment typo iotests: Disable 126 for flat vmdk subformats iotests: Disable 110 for vmdk.twoGbMaxExtentSparse iotests: Disable broken streamOptimized tests vmdk: Reject invalid compressed writes iotests: Keep testing broken relative extent paths vmdk: Use bdrv_dirname() for relative extent paths iotests: Fix _filter_img_create() iotests: Test allocate_first_block() with O_DIRECT block: posix: Always allocate the first block block: fix permission update in bdrv_replace_node qemu-io: add pattern file for write command
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
#
3a20013f |
| 26-Aug-2019 |
Nir Soffer <nirsof@gmail.com> |
block: posix: Always allocate the first block
When creating an image with preallocation "off" or "falloc", the first block of the image is typically not allocated. When using Gluster storage backed
block: posix: Always allocate the first block
When creating an image with preallocation "off" or "falloc", the first block of the image is typically not allocated. When using Gluster storage backed by XFS filesystem, reading this block using direct I/O succeeds regardless of request length, fooling alignment detection.
In this case we fallback to a safe value (4096) instead of the optimal value (512), which may lead to unneeded data copying when aligning requests. Allocating the first block avoids the fallback.
Since we allocate the first block even with preallocation=off, we no longer create images with zero disk size:
$ ./qemu-img create -f raw test.raw 1g Formatting 'test.raw', fmt=raw size=1073741824
$ ls -lhs test.raw 4.0K -rw-r--r--. 1 nsoffer nsoffer 1.0G Aug 16 23:48 test.raw
And converting the image requires additional cluster:
$ ./qemu-img measure -f raw -O qcow2 test.raw required size: 458752 fully allocated size: 1074135040
When using format like vmdk with multiple files per image, we allocate one block per file:
$ ./qemu-img create -f vmdk -o subformat=twoGbMaxExtentFlat test.vmdk 4g Formatting 'test.vmdk', fmt=vmdk size=4294967296 compat6=off hwversion=undefined subformat=twoGbMaxExtentFlat
$ ls -lhs test*.vmdk 4.0K -rw-r--r--. 1 nsoffer nsoffer 2.0G Aug 27 03:23 test-f001.vmdk 4.0K -rw-r--r--. 1 nsoffer nsoffer 2.0G Aug 27 03:23 test-f002.vmdk 4.0K -rw-r--r--. 1 nsoffer nsoffer 353 Aug 27 03:23 test.vmdk
I did quick performance test for copying disks with qemu-img convert to new raw target image to Gluster storage with sector size of 512 bytes:
for i in $(seq 10); do rm -f dst.raw sleep 10 time ./qemu-img convert -f raw -O raw -t none -T none src.raw dst.raw done
Here is a table comparing the total time spent:
Type Before(s) After(s) Diff(%) --------------------------------------- real 530.028 469.123 -11.4 user 17.204 10.768 -37.4 sys 17.881 7.011 -60.7
We can see very clear improvement in CPU usage.
Signed-off-by: Nir Soffer <nsoffer@redhat.com> Message-id: 20190827010528.8818-2-nsoffer@redhat.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
show more ...
|