Re: [Qemu-block] [PATCH v4 3/8] ide: account UNMAP (TRIM) operations

2018-10-17 Thread Anton Nefedov
On 8/10/2018 7:43 PM, Kevin Wolf wrote: > Am 08.10.2018 um 18:04 hat Anton Nefedov geschrieben: >> >> >> On 8/10/2018 6:46 PM, Kevin Wolf wrote: >>> Am 08.10.2018 um 17:25 hat Anton Nefedov geschrieben: >>>> >>>> >>>> On 8/10/2018

[Qemu-block] [PATCH v5 0/9] discard blockstats

2018-10-31 Thread Anton Nefedov
": 143, "failed_wr_operations": 0, "rd_operations": 4816, "account_failed": true, > "unmap_merged": 0, "wr_total_time_ns": 1262686124, "invalid_rd_operations": 0 }, "par

[Qemu-block] [PATCH v5 5/9] scsi: store unmap offset and nb_sectors in request struct

2018-10-31 Thread Anton Nefedov
it allows to report it in the error handler Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia --- hw/scsi/scsi-disk.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c

[Qemu-block] [PATCH v5 2/9] qapi: add unmap to BlockDeviceStats

2018-10-31 Thread Anton Nefedov
Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia Reviewed-by: Eric Blake --- qapi/block-core.json | 29 +++-- include/block/accounting.h | 1 + block/qapi.c | 6 ++ tests/qemu-iotests/227.out

[Qemu-block] [PATCH v5 1/9] qapi: group BlockDeviceStats fields

2018-10-31 Thread Anton Nefedov
Make the stat fields definition slightly more readable. Also reorder total_time_ns stats read-write-flush as done elsewhere. Cosmetic change only. Signed-off-by: Anton Nefedov --- qapi/block-core.json | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git

[Qemu-block] [PATCH v5 4/9] ide: account UNMAP (TRIM) operations

2018-10-31 Thread Anton Nefedov
Signed-off-by: Anton Nefedov --- hw/ide/core.c | 12 1 file changed, 12 insertions(+) diff --git a/hw/ide/core.c b/hw/ide/core.c index 04e22e751d..8da77ff3e3 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -441,6 +441,14 @@ static void ide_issue_trim_cb(void *opaque, int ret

[Qemu-block] [PATCH v5 8/9] file-posix: account discard operations

2018-10-31 Thread Anton Nefedov
numbers will not include discards triggered by write-zeroes + MAY_UNMAP calls. Signed-off-by: Anton Nefedov --- block/file-posix.c | 28 +--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index 2da3a76355..1a7126046c

[Qemu-block] [PATCH v5 6/9] scsi: move unmap error checking to the complete callback

2018-10-31 Thread Anton Nefedov
in blk_aio() functions anyway. Same approach is already used for emulate_write_same. Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia --- hw/scsi/scsi-disk.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/scsi/scsi-d

[Qemu-block] [PATCH v5 7/9] scsi: account unmap operations

2018-10-31 Thread Anton Nefedov
Signed-off-by: Anton Nefedov --- hw/scsi/scsi-disk.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index e132504913..dee71f9dde 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -1663,10 +1663,16 @@ static

[Qemu-block] [PATCH v5 9/9] qapi: query-blockstat: add driver specific file-posix stats

2018-10-31 Thread Anton Nefedov
A block driver can provide a callback to report driver-specific statistics. file-posix driver now reports discard statistics Signed-off-by: Anton Nefedov --- qapi/block-core.json | 39 +++ include/block/block.h | 1 + include/block/block_int.h | 1

[Qemu-block] [PATCH v5 3/9] block: add empty account cookie type

2018-10-31 Thread Anton Nefedov
ounting separately. Signed-off-by: Anton Nefedov --- include/block/accounting.h | 1 + block/accounting.c | 6 ++ 2 files changed, 7 insertions(+) diff --git a/include/block/accounting.h b/include/block/accounting.h index ba8b04d572..878b4c3581 100644 --- a/include/block/accounting.h +

Re: [Qemu-block] [PATCH v5 3/9] block: add empty account cookie type

2018-11-26 Thread Anton Nefedov
On 23/11/2018 7:04 PM, Vladimir Sementsov-Ogievskiy wrote: > 31.10.2018 14:34, Anton Nefedov wrote: >> This adds some protection from accounting unitialized cookie. > > uninitialized > fixed >> That is, block_acct_failed/done without previous block_acct_start;

Re: [Qemu-block] [PATCH v5 7/9] scsi: account unmap operations

2018-11-26 Thread Anton Nefedov
On 23/11/2018 9:25 PM, Vladimir Sementsov-Ogievskiy wrote: > 31.10.2018 14:34, Anton Nefedov wrote: >> Signed-off-by: Anton Nefedov > > > Reviewed-by: Vladimir Sementsov-Ogievskiy > > but be careful: on git am, the chunk about read-only case goes into > scsi_disk

Re: [Qemu-block] [PATCH v5 9/9] qapi: query-blockstat: add driver specific file-posix stats

2018-11-26 Thread Anton Nefedov
On 23/11/2018 10:21 PM, Vladimir Sementsov-Ogievskiy wrote: > 31.10.2018 14:35, Anton Nefedov wrote: >> A block driver can provide a callback to report driver-specific >> statistics. >> >> file-posix driver now reports discard statistics >> >> Signed-off-by:

[Qemu-block] [PATCH v6 0/9] discard blockstats

2018-11-30 Thread Anton Nefedov
ations": 0, "rd_operations": 4816, "account_failed": true, > "unmap_merged": 0, "wr_total_time_ns": 1262686124, "invalid_rd_operations": 0 }, "parent": { > "driver-specif

[Qemu-block] [PATCH v6 3/9] block: add empty account cookie type

2018-11-30 Thread Anton Nefedov
ounting separately. Signed-off-by: Anton Nefedov --- include/block/accounting.h | 1 + block/accounting.c | 6 ++ 2 files changed, 7 insertions(+) diff --git a/include/block/accounting.h b/include/block/accounting.h index ba8b04d572..878b4c3581 100644 --- a/include/block/accounting.h +

[Qemu-block] [PATCH v6 4/9] ide: account UNMAP (TRIM) operations

2018-11-30 Thread Anton Nefedov
Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy --- hw/ide/core.c | 12 1 file changed, 12 insertions(+) diff --git a/hw/ide/core.c b/hw/ide/core.c index 04e22e751d..8da77ff3e3 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -441,6 +441,14 @@ static void

[Qemu-block] [PATCH v6 2/9] qapi: add unmap to BlockDeviceStats

2018-11-30 Thread Anton Nefedov
Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia Reviewed-by: Eric Blake --- qapi/block-core.json | 29 +++-- include/block/accounting.h | 1 + block/qapi.c | 6 ++ tests/qemu-iotests/227.out

[Qemu-block] [PATCH v6 5/9] scsi: store unmap offset and nb_sectors in request struct

2018-11-30 Thread Anton Nefedov
it allows to report it in the error handler Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia --- hw/scsi/scsi-disk.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c

[Qemu-block] [PATCH v6 6/9] scsi: move unmap error checking to the complete callback

2018-11-30 Thread Anton Nefedov
in blk_aio() functions anyway. Same approach is already used for emulate_write_same. Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia --- hw/scsi/scsi-disk.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/scsi/scsi-d

[Qemu-block] [PATCH v6 8/9] file-posix: account discard operations

2018-11-30 Thread Anton Nefedov
numbers will not include discards triggered by write-zeroes + MAY_UNMAP calls. Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/file-posix.c | 28 +--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/block/file-posix.c b/block

[Qemu-block] [PATCH v6 1/9] qapi: group BlockDeviceStats fields

2018-11-30 Thread Anton Nefedov
Make the stat fields definition slightly more readable. Also reorder total_time_ns stats read-write-flush as done elsewhere. Cosmetic change only. Signed-off-by: Anton Nefedov Reviewed-by: Alberto Garcia Reviewed-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.json | 26

[Qemu-block] [PATCH v6 7/9] scsi: account unmap operations

2018-11-30 Thread Anton Nefedov
Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy --- hw/scsi/scsi-disk.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index daf37d117c..3968fc6fac 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi

[Qemu-block] [PATCH v6 9/9] qapi: query-blockstat: add driver specific file-posix stats

2018-11-30 Thread Anton Nefedov
A block driver can provide a callback to report driver-specific statistics. file-posix driver now reports discard statistics Signed-off-by: Anton Nefedov --- qapi/block-core.json | 38 ++ include/block/block.h | 1 + include/block/block_int.h | 1

[Qemu-block] [PATCH v10 7/9] block: support BDRV_REQ_ALLOCATE in passthrough drivers

2018-12-03 Thread Anton Nefedov
Support the flag if the underlying BDS supports it Signed-off-by: Anton Nefedov --- block/blkdebug.c | 2 +- block/blkverify.c| 2 +- block/copy-on-read.c | 4 ++-- block/mirror.c | 2 +- block/raw-format.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a

[Qemu-block] [PATCH v10 4/9] block: introduce BDRV_REQ_ALLOCATE flag

2018-12-03 Thread Anton Nefedov
the common block layer (so it will not fall back to any slowpath (like writing zero buffers) in case the driver does not support the flag). Signed-off-by: Anton Nefedov Reviewed-by: Alberto Garcia --- include/block/block.h | 9 - include/block/block_int.h | 2 +- block/io.c

[Qemu-block] [PATCH v10 0/9] qcow2: cluster space preallocation

2018-12-03 Thread Anton Nefedov
61.153 | 36.313 | 41% | |hdd| 112.676 | 122.056 | -8% | +---+--+--+------+ Anton Nefedov (9): mirror: inherit supported write/zero flags blkverify: set supported write/zero flags quorum: set supported write flags bloc

[Qemu-block] [PATCH v10 2/9] blkverify: set supported write/zero flags

2018-12-03 Thread Anton Nefedov
Signed-off-by: Anton Nefedov --- block/blkverify.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/block/blkverify.c b/block/blkverify.c index 89bf4386e3..bb52596cbb 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -141,8 +141,14 @@ static int

[Qemu-block] [PATCH v10 9/9] iotest 134: test cluster-misaligned encrypted write

2018-12-03 Thread Anton Nefedov
COW (even empty/zero) areas require encryption too Signed-off-by: Anton Nefedov Reviewed-by: Eric Blake Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia --- tests/qemu-iotests/134 | 9 + tests/qemu-iotests/134.out | 10 ++ 2 files changed, 19 insertions(+) diff --git

[Qemu-block] [PATCH v10 1/9] mirror: inherit supported write/zero flags

2018-12-03 Thread Anton Nefedov
Signed-off-by: Anton Nefedov --- block/mirror.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index 56d9ef7474..56908c9b19 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1528,8 +1528,12 @@ static void mirror_start_job(const char

[Qemu-block] [PATCH v10 6/9] file-posix: support BDRV_REQ_ALLOCATE

2018-12-03 Thread Anton Nefedov
Current write_zeroes implementation is good enough to satisfy this flag too Signed-off-by: Anton Nefedov --- block/file-posix.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index 07bbdab953..b0b7ab0159 100644 --- a/block/file

[Qemu-block] [PATCH v10 5/9] block: treat BDRV_REQ_ALLOCATE as serialising

2018-12-03 Thread Anton Nefedov
request is in flight already. Return EAGAIN, let the caller reconsider. Signed-off-by: Anton Nefedov --- block/io.c | 31 --- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/block/io.c b/block/io.c index d9d7644858..6ff946f63d 100644 --- a/block

[Qemu-block] [PATCH v10 3/9] quorum: set supported write flags

2018-12-03 Thread Anton Nefedov
Signed-off-by: Anton Nefedov --- block/quorum.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/block/quorum.c b/block/quorum.c index 16b3c8067c..d21a6a3b8e 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -857,6 +857,19 @@ static QemuOptsList

[Qemu-block] [PATCH v10 8/9] qcow2: skip writing zero buffers to empty COW areas

2018-12-03 Thread Anton Nefedov
anymore. Use a backing image instead. Signed-off-by: Anton Nefedov Reviewed-by: Alberto Garcia --- qapi/block-core.json | 4 +- block/qcow2.h | 6 +++ block/qcow2-cluster.c | 2 +- block/qcow2.c | 80 +- block/trace-events

Re: [Qemu-block] [PATCH v10 8/9] qcow2: skip writing zero buffers to empty COW areas

2018-12-03 Thread Anton Nefedov
On 3/12/2018 4:59 PM, Alberto Garcia wrote: > On Mon 03 Dec 2018 11:14:59 AM CET, Anton Nefedov wrote: >> --- a/qapi/block-core.json >> +++ b/qapi/block-core.json >> @@ -3004,6 +3004,8 @@ >> # >> # @cor_write: a write due to copy-on-read (since 2.11) >

Re: [Qemu-block] [PATCH v10 1/9] mirror: inherit supported write/zero flags

2018-12-05 Thread Anton Nefedov
s, but since BDRV_REQ_ALLOCATE flag is added, so we might want to expose it where possible. > Is it a bug, that FUA was not inherited before? > I don't think it's a bug really since there is a fallback path in block/io.c. > 03.12.2018 13:14, Anton Nefedov wrote: >&g

Re: [Qemu-block] [PATCH v10 4/9] block: introduce BDRV_REQ_ALLOCATE flag

2018-12-05 Thread Anton Nefedov
On 5/12/2018 3:59 PM, Vladimir Sementsov-Ogievskiy wrote: > 03.12.2018 13:14, Anton Nefedov wrote: >> The flag is supposed to indicate that the region of the disk image has >> to be sufficiently allocated so it reads as zeroes. >> >> The call with the flag set must re

Re: [Qemu-block] [PATCH v10 5/9] block: treat BDRV_REQ_ALLOCATE as serialising

2018-12-05 Thread Anton Nefedov
On 5/12/2018 4:14 PM, Vladimir Sementsov-Ogievskiy wrote: > 03.12.2018 13:14, Anton Nefedov wrote: >> The idea is that ALLOCATE requests may overlap with other requests. > > please, describe why > It is not used in this series from some point, but the idea is that th

Re: [Qemu-block] [PATCH v10 6/9] file-posix: support BDRV_REQ_ALLOCATE

2018-12-05 Thread Anton Nefedov
On 5/12/2018 4:25 PM, Vladimir Sementsov-Ogievskiy wrote: > 03.12.2018 13:14, Anton Nefedov wrote: >> Current write_zeroes implementation is good enough to satisfy this flag too >> >> Signed-off-by: Anton Nefedov >> --- >>block/file-posix.c | 8 +++- &

Re: [Qemu-block] [PATCH v10 8/9] qcow2: skip writing zero buffers to empty COW areas

2018-12-05 Thread Anton Nefedov
On 5/12/2018 5:01 PM, Vladimir Sementsov-Ogievskiy wrote: > 03.12.2018 13:14, Anton Nefedov wrote: >> If COW areas of the newly allocated clusters are zeroes on the backing image, >> efficient bdrv_write_zeroes(flags=BDRV_REQ_ALLOCATE) can be used on the whole >> clust

Re: [Qemu-block] [PATCH v10 3/9] quorum: set supported write flags

2018-12-07 Thread Anton Nefedov
On 7/12/2018 5:33 PM, Alberto Garcia wrote: > On Mon 03 Dec 2018 11:14:55 AM CET, Anton Nefedov wrote: >> Signed-off-by: Anton Nefedov >> --- >> block/quorum.c | 19 ++- >> 1 file changed, 18 insertions(+), 1 deletion(-) >> >> diff

Re: [Qemu-block] [PATCH v10 5/9] block: treat BDRV_REQ_ALLOCATE as serialising

2018-12-13 Thread Anton Nefedov
On 12/12/2018 3:48 PM, Vladimir Sementsov-Ogievskiy wrote: > 05.12.2018 17:01, Anton Nefedov wrote: >> --- a/include/block/block.h >> +++ b/include/block/block.h >> @@ -87,6 +87,9 @@ typedef enum { >> * efficiently allocate the space so it reads as ze

Re: [Qemu-block] [PATCH v10 6/9] file-posix: support BDRV_REQ_ALLOCATE

2018-12-13 Thread Anton Nefedov
On 12/12/2018 8:19 PM, Vladimir Sementsov-Ogievskiy wrote: > 05.12.2018 17:11, Anton Nefedov wrote: >> On 5/12/2018 4:25 PM, Vladimir Sementsov-Ogievskiy wrote: >>> 03.12.2018 13:14, Anton Nefedov wrote: >>>> } >>>> #endif >

Re: [Qemu-block] [PATCH v10 8/9] qcow2: skip writing zero buffers to empty COW areas

2018-12-13 Thread Anton Nefedov
On 13/12/2018 3:02 PM, Vladimir Sementsov-Ogievskiy wrote: > 03.12.2018 13:14, Anton Nefedov wrote: >> If COW areas of the newly allocated clusters are zeroes on the backing image, >> efficient bdrv_write_zeroes(flags=BDRV_REQ_ALLOCATE) can be used on the whole >> clust

Re: [Qemu-block] [Qemu-devel] [PATCH v6 9/9] qapi: query-blockstat: add driver specific file-posix stats

2018-12-13 Thread Anton Nefedov
On 13/12/2018 3:20 PM, Markus Armbruster wrote: > I'm reviewing just the QAPI schema today. > > Anton Nefedov writes: > >> A block driver can provide a callback to report driver-specific >> statistics. >> >> file-posix driver now reports discard stat

Re: [Qemu-block] [PATCH v10 8/9] qcow2: skip writing zero buffers to empty COW areas

2018-12-17 Thread Anton Nefedov
On 14/12/2018 7:20 PM, Vladimir Sementsov-Ogievskiy wrote: > 03.12.2018 13:14, Anton Nefedov wrote: >> If COW areas of the newly allocated clusters are zeroes on the backing image, >> efficient bdrv_write_zeroes(flags=BDRV_REQ_ALLOCATE) can be used on the whole >> clust

[Qemu-block] [PATCH v11 04/10] block: introduce BDRV_REQ_ALLOCATE flag

2018-12-17 Thread Anton Nefedov
the common block layer (so it will not fall back to any slowpath (like writing zero buffers) in case the driver does not support the flag). Signed-off-by: Anton Nefedov --- include/block/block.h | 10 +- include/block/block_int.h | 3 ++- block/io.c| 14

[Qemu-block] [PATCH v11 01/10] mirror: inherit supported write/zero flags

2018-12-17 Thread Anton Nefedov
Signed-off-by: Anton Nefedov Reviewed-by: Alberto Garcia Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/mirror.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index ab59ad77e8..be52c9be9c 100644 --- a/block/mirror.c +++ b/block

[Qemu-block] [PATCH v11 06/10] file-posix: reset fallocate-related flags without CONFIG_FALLOCATE*

2018-12-17 Thread Anton Nefedov
these flags currently affect nothing without CONFIG_FALLOCATE*, so it's not a bug. Fixing it makes possible to adjust supported zero flag BDRV_REQ_ALLOCATE regardless of configuration (in the following patch). Signed-off-by: Anton Nefedov --- block/file-posix.c | 8 ++-- 1 file chang

[Qemu-block] [PATCH v11 00/10] qcow2: cluster space preallocation

2018-12-18 Thread Anton Nefedov
|ssd| 61.153 | 36.313 | 41% | |hdd| 112.676 | 122.056 | -8% | +---+--+--+------+ Anton Nefedov (10): mirror: inherit supported write/zero flags blkverify: set supported write/zero flags quorum: set supported write f

[Qemu-block] [PATCH v11 02/10] blkverify: set supported write/zero flags

2018-12-18 Thread Anton Nefedov
Signed-off-by: Anton Nefedov Reviewed-by: Alberto Garcia Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/blkverify.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/block/blkverify.c b/block/blkverify.c index 89bf4386e3..bb52596cbb 100644 --- a/block

[Qemu-block] [PATCH v11 05/10] block: treat BDRV_REQ_ALLOCATE as serialising

2018-12-18 Thread Anton Nefedov
request is in flight already. Return EAGAIN, let the caller reconsider. Signed-off-by: Anton Nefedov --- include/block/block.h | 3 +++ block/io.c| 31 --- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/include/block/block.h b/include

[Qemu-block] [PATCH v11 03/10] quorum: set supported write flags

2018-12-18 Thread Anton Nefedov
Signed-off-by: Anton Nefedov Reviewed-by: Alberto Garcia Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/quorum.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/block/quorum.c b/block/quorum.c index 16b3c8067c..d21a6a3b8e 100644 --- a/block/quorum.c

[Qemu-block] [PATCH v11 10/10] iotest 134: test cluster-misaligned encrypted write

2018-12-18 Thread Anton Nefedov
COW (even empty/zero) areas require encryption too Signed-off-by: Anton Nefedov Reviewed-by: Eric Blake Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia --- tests/qemu-iotests/134 | 9 + tests/qemu-iotests/134.out | 10 ++ 2 files changed, 19 insertions(+) diff --git

[Qemu-block] [PATCH v11 08/10] block: support BDRV_REQ_ALLOCATE in passthrough drivers

2018-12-18 Thread Anton Nefedov
Support the flag if the underlying BDS supports it Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia --- block/blkdebug.c | 2 +- block/blkverify.c| 2 +- block/copy-on-read.c | 4 ++-- block/mirror.c | 2 +- block/raw-format.c

[Qemu-block] [PATCH v11 07/10] file-posix: support BDRV_REQ_ALLOCATE

2018-12-18 Thread Anton Nefedov
Current write_zeroes implementation is good enough to satisfy this flag too Signed-off-by: Anton Nefedov --- block/file-posix.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index a65e464cbc..c3fbf53853 100644 --- a/block/file

[Qemu-block] [PATCH v11 09/10] qcow2: skip writing zero buffers to empty COW areas

2018-12-18 Thread Anton Nefedov
anymore. Use a backing image instead. Signed-off-by: Anton Nefedov --- qapi/block-core.json | 4 +- block/qcow2.h | 6 +++ block/qcow2-cluster.c | 2 +- block/qcow2.c | 89 +- block/trace-events | 1 + tests/qemu

Re: [Qemu-block] [PATCH v11 09/10] qcow2: skip writing zero buffers to empty COW areas

2018-12-24 Thread Anton Nefedov
On 21/12/2018 7:16 PM, Vladimir Sementsov-Ogievskiy wrote: > 18.12.2018 10:57, Anton Nefedov wrote: >> If COW areas of the newly allocated clusters are zeroes on the backing image, >> efficient bdrv_write_zeroes(flags=BDRV_REQ_ALLOCATE) can be used on the whole >> clust

[Qemu-block] [PATCH v12 01/10] mirror: inherit supported write/zero flags

2019-01-14 Thread Anton Nefedov
Signed-off-by: Anton Nefedov Reviewed-by: Alberto Garcia Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/mirror.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index f0b211a9c8..7b5a5f13a2 100644 --- a/block/mirror.c +++ b/block

[Qemu-block] [PATCH v12 04/10] block: introduce BDRV_REQ_ALLOCATE flag

2019-01-14 Thread Anton Nefedov
the common block layer (so it will not fall back to any slowpath (like writing zero buffers) in case the driver does not support the flag). Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia --- include/block/block.h | 10

[Qemu-block] [PATCH v12 00/10] qcow2: cluster space preallocation

2019-01-14 Thread Anton Nefedov
| file|before| after| gain | +---+---+--+---+--+--+ |ssd| 61.153 | 36.313 | 41% | |hdd| 112.676 | 122.056 | -8% | +---+--+--+------+ Anton Nefedov (10): mir

[Qemu-block] [PATCH v12 03/10] quorum: set supported write flags

2019-01-14 Thread Anton Nefedov
Signed-off-by: Anton Nefedov Reviewed-by: Alberto Garcia Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/quorum.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/block/quorum.c b/block/quorum.c index 16b3c8067c..d21a6a3b8e 100644 --- a/block/quorum.c

[Qemu-block] [PATCH v12 06/10] file-posix: reset fallocate-related flags without CONFIG_FALLOCATE*

2019-01-14 Thread Anton Nefedov
these flags currently affect nothing without CONFIG_FALLOCATE*, so it's not a bug, but fixing it makes possible to adjust supported zero flag BDRV_REQ_ALLOCATE regardless of configuration. Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto G

[Qemu-block] [PATCH v12 08/10] block: support BDRV_REQ_ALLOCATE in passthrough drivers

2019-01-14 Thread Anton Nefedov
Support the flag if the underlying BDS supports it Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia --- block/blkdebug.c | 2 +- block/blkverify.c| 2 +- block/copy-on-read.c | 4 ++-- block/mirror.c | 2 +- block/raw-format.c

[Qemu-block] [PATCH v12 10/10] iotest 134: test cluster-misaligned encrypted write

2019-01-14 Thread Anton Nefedov
COW (even empty/zero) areas require encryption too Signed-off-by: Anton Nefedov Reviewed-by: Eric Blake Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia --- tests/qemu-iotests/134 | 9 + tests/qemu-iotests/134.out | 10 ++ 2 files changed, 19 insertions(+) diff --git

[Qemu-block] [PATCH v12 09/10] qcow2: skip writing zero buffers to empty COW areas

2019-01-14 Thread Anton Nefedov
anymore. Use a backing image instead. Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.json | 4 +- block/qcow2.h | 6 +++ block/qcow2-cluster.c | 2 +- block/qcow2.c | 91 +- block

[Qemu-block] [PATCH v12 02/10] blkverify: set supported write/zero flags

2019-01-14 Thread Anton Nefedov
Signed-off-by: Anton Nefedov Reviewed-by: Alberto Garcia Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/blkverify.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/block/blkverify.c b/block/blkverify.c index 89bf4386e3..bb52596cbb 100644 --- a/block

[Qemu-block] [PATCH v12 05/10] block: treat BDRV_REQ_ALLOCATE as serialising

2019-01-14 Thread Anton Nefedov
request is in flight already. Return EAGAIN, let the caller reconsider. Signed-off-by: Anton Nefedov Reviewed-by: Alberto Garcia --- include/block/block.h | 3 +++ block/io.c| 31 --- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a

[Qemu-block] [PATCH v12 07/10] file-posix: support BDRV_REQ_ALLOCATE

2019-01-14 Thread Anton Nefedov
Current write_zeroes implementation is good enough to satisfy this flag too Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia --- block/file-posix.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/block/file-posix.c b

Re: [Qemu-block] [PATCH v6 0/9] discard blockstats

2019-01-14 Thread Anton Nefedov
On 30/11/2018 5:47 PM, Anton Nefedov wrote: > qmp query-blockstats provides stats info for write/read/flush ops. > > Patches 1-7 implement the similar for discard (unmap) command for scsi > and ide disks. > Discard stat "unmap_ops / unmap_bytes" is supposed to ac

Re: [Qemu-block] [PATCH v12 09/10] qcow2: skip writing zero buffers to empty COW areas

2019-01-16 Thread Anton Nefedov
On 15/1/2019 6:27 PM, Alberto Garcia wrote: > On Mon 14 Jan 2019 12:18:30 PM CET, Anton Nefedov wrote: >> If COW areas of the newly allocated clusters are zeroes on the backing image, >> efficient bdrv_write_zeroes(flags=BDRV_REQ_ALLOCATE) can be used on the whole >> clust

Re: [Qemu-block] [PATCH v2 01/15] block: introduce BDRV_REQ_ALLOCATE flag

2017-06-02 Thread Anton Nefedov
On 06/01/2017 10:07 PM, Eric Blake wrote: On 06/01/2017 10:14 AM, Anton Nefedov wrote: The flag is supposed to indicate that the region of the disk image has to be sufficiently allocated so it reads as zeroes. The call with the flag set has to return -ENOTSUP if allocation cannot be done

Re: [Qemu-block] [PATCH v2 03/15] blkdebug: support BDRV_REQ_ALLOCATE

2017-06-02 Thread Anton Nefedov
On 06/01/2017 10:50 PM, Eric Blake wrote: On 06/01/2017 10:14 AM, Anton Nefedov wrote: Support the flag if the underlying BDS supports it Signed-off-by: Anton Nefedov --- block/blkdebug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Shouldn't other passthrough drivers

Re: [Qemu-block] [Qemu-devel] [PATCH v2 02/15] file-posix: support BDRV_REQ_ALLOCATE

2017-06-02 Thread Anton Nefedov
On 06/01/2017 10:54 PM, Eric Blake wrote: On 06/01/2017 02:49 PM, Eric Blake wrote: On 06/01/2017 10:14 AM, Anton Nefedov wrote: Current write_zeroes implementation is good enough to satisfy this flag too Signed-off-by: Anton Nefedov --- block/file-posix.c | 9 - 1 file changed

[Qemu-block] [PATCH v3 05/13] qcow2: preallocation at image expand

2017-07-31 Thread Anton Nefedov
e resolved by the common block layer code since ALLOCATE requests are serialising. Signed-off-by: Denis V. Lunev Signed-off-by: Anton Nefedov --- block/qcow2.h | 3 +++ block/qcow2.c | 62 +++-- qemu-options.hx | 4 3 files c

[Qemu-block] [PATCH v3 02/13] block: treat BDRV_REQ_ALLOCATE as serialising

2017-07-31 Thread Anton Nefedov
request is in flight already. Return EAGAIN, let the caller reconsider. Signed-off-by: Anton Nefedov --- block/io.c | 27 +++ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/block/io.c b/block/io.c index b3f9d61..1b935d8 100644 --- a/block/io.c +++ b/block

[Qemu-block] [PATCH v3 06/13] qcow2: set inactive flag

2017-07-31 Thread Anton Nefedov
Qcow2State and BlockDriverState flags have to be in sync Signed-off-by: Anton Nefedov --- block/qcow2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/qcow2.c b/block/qcow2.c index 1939d9b..b11dc48 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -2135,6 +2135,7 @@ static int

[Qemu-block] [PATCH v3 04/13] block: support BDRV_REQ_ALLOCATE in passthrough drivers

2017-07-31 Thread Anton Nefedov
Support the flag if the underlying BDS supports it Signed-off-by: Anton Nefedov --- block/blkdebug.c | 3 ++- block/raw-format.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index c19ab28..ef2d764 100644 --- a/block/blkdebug.c

[Qemu-block] [PATCH v3 01/13] block: introduce BDRV_REQ_ALLOCATE flag

2017-07-31 Thread Anton Nefedov
The flag is supposed to indicate that the region of the disk image has to be sufficiently allocated so it reads as zeroes. The call with the flag set has to return -ENOTSUP if allocation cannot be done efficiently (i.e. without falling back to writing actual buffers) Signed-off-by: Anton Nefedov

[Qemu-block] [PATCH v3 03/13] file-posix: support BDRV_REQ_ALLOCATE

2017-07-31 Thread Anton Nefedov
Current write_zeroes implementation is good enough to satisfy this flag too Signed-off-by: Anton Nefedov --- block/file-posix.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index cfbb236..bd52b31 100644 --- a/block/file

[Qemu-block] [PATCH v3 00/13] qcow2: space preallocation and COW improvements

2017-07-31 Thread Anton Nefedov
lel sequential write operations which are not cluster-aligned Performance test results are added to commit messages (see patch 3, 12) Anton Nefedov (10): block: introduce BDRV_REQ_ALLOCATE flag block: treat BDRV_REQ_ALLOCATE as serialising file-posix: support BDRV_REQ_ALLOCATE block: support

[Qemu-block] [PATCH v3 13/13] iotest 134: test cluster-misaligned encrypted write

2017-07-31 Thread Anton Nefedov
COW (even empty/zero) areas require encryption too Signed-off-by: Anton Nefedov --- tests/qemu-iotests/134 | 9 + tests/qemu-iotests/134.out | 10 ++ 2 files changed, 19 insertions(+) diff --git a/tests/qemu-iotests/134 b/tests/qemu-iotests/134 index 9914415..6083ae4

[Qemu-block] [PATCH v3 07/13] qcow2: truncate preallocated space

2017-07-31 Thread Anton Nefedov
From: "Denis V. Lunev" This could be done after calculation of the end of data and metadata in the qcow2 image. Signed-off-by: Denis V. Lunev Signed-off-by: Anton Nefedov --- block/qcow2.h | 3 +++ block/qcow2-cluster.c | 9 + block/qcow2-refcount.c | 7 +++ b

[Qemu-block] [PATCH v3 09/13] qcow2: move is_zero_sectors() up

2017-07-31 Thread Anton Nefedov
To be used in the following commit without a forward declaration. Signed-off-by: Anton Nefedov --- block/qcow2.c | 39 +++ 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 0f4de40..5c7c2b5 100644 --- a/block

[Qemu-block] [PATCH v3 11/13] qcow2: allocate image space by-cluster

2017-07-31 Thread Anton Nefedov
uster-alignment areas that were not really COWed are now detected as zeroes, hence the initial write has to be exactly the same size for the maps to match Signed-off-by: Anton Nefedov --- block/qcow2.c | 22 +- tests/qemu-iotests/060 | 2 +- tests/qemu-iotest

[Qemu-block] [PATCH v3 10/13] qcow2: skip writing zero buffers to empty COW areas

2017-07-31 Thread Anton Nefedov
It can be detected that 1. COW alignment of a write request is zeroes 2. Respective areas on the underlying BDS already read as zeroes after being preallocated previously If both of these true, COW may be skipped Signed-off-by: Anton Nefedov --- block/qcow2.h | 12

[Qemu-block] [PATCH v3 12/13] iotest 190: test BDRV_REQ_ALLOCATE

2017-07-31 Thread Anton Nefedov
Signed-off-by: Anton Nefedov --- tests/qemu-iotests/190 | 146 + tests/qemu-iotests/190.out | 50 tests/qemu-iotests/group | 1 + 3 files changed, 197 insertions(+) create mode 100755 tests/qemu-iotests/190 create mode

[Qemu-block] [PATCH v3 08/13] qcow2: check space leak at the end of the image

2017-07-31 Thread Anton Nefedov
From: Pavel Butsykin Preallocated space in the image may remain unused; the patch adds the functionality to identify and fix it in the qcow2_check to avoid wasting storage space on the host. Signed-off-by: Pavel Butsykin Signed-off-by: Denis V. Lunev Signed-off-by: Anton Nefedov --- block

Re: [Qemu-block] [PATCH v3 04/13] block: support BDRV_REQ_ALLOCATE in passthrough drivers

2017-08-01 Thread Anton Nefedov
On 07/31/2017 10:11 PM, Eric Blake wrote: On 07/31/2017 11:21 AM, Anton Nefedov wrote: Support the flag if the underlying BDS supports it Signed-off-by: Anton Nefedov --- block/blkdebug.c | 3 ++- block/raw-format.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) What about

Re: [Qemu-block] [PATCH v3 09/13] qcow2: move is_zero_sectors() up

2017-08-01 Thread Anton Nefedov
On 07/31/2017 10:13 PM, Eric Blake wrote: On 07/31/2017 11:22 AM, Anton Nefedov wrote: To be used in the following commit without a forward declaration. Signed-off-by: Anton Nefedov --- block/qcow2.c | 39 +++ 1 file changed, 19 insertions(+), 20

[Qemu-block] [PATCH v4 01/15] mirror: inherit supported write/zero flags

2017-08-01 Thread Anton Nefedov
Signed-off-by: Anton Nefedov --- block/mirror.c | 5 + 1 file changed, 5 insertions(+) diff --git a/block/mirror.c b/block/mirror.c index d46dace..7e539f1 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1056,6 +1056,11 @@ static void bdrv_mirror_top_refresh_filename(BlockDriverState

[Qemu-block] [PATCH v4 05/15] file-posix: support BDRV_REQ_ALLOCATE

2017-08-01 Thread Anton Nefedov
Current write_zeroes implementation is good enough to satisfy this flag too Signed-off-by: Anton Nefedov --- block/file-posix.c | 8 1 file changed, 8 insertions(+) diff --git a/block/file-posix.c b/block/file-posix.c index 765a440..4ef1b1d 100644 --- a/block/file-posix.c +++ b/block

[Qemu-block] [PATCH v4 06/15] block: support BDRV_REQ_ALLOCATE in passthrough drivers

2017-08-01 Thread Anton Nefedov
Support the flag if the underlying BDS supports it Signed-off-by: Anton Nefedov --- block/blkdebug.c | 3 ++- block/blkverify.c | 2 +- block/mirror.c | 2 +- block/raw-format.c | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c

[Qemu-block] [PATCH v4 08/15] qcow2: set inactive flag

2017-08-01 Thread Anton Nefedov
Qcow2State and BlockDriverState flags have to be in sync Signed-off-by: Anton Nefedov --- block/qcow2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/qcow2.c b/block/qcow2.c index 66aa8c2..2a1d2f2 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -2138,6 +2138,7 @@ static int

[Qemu-block] [PATCH v4 04/15] block: treat BDRV_REQ_ALLOCATE as serialising

2017-08-01 Thread Anton Nefedov
request is in flight already. Return EAGAIN, let the caller reconsider. Signed-off-by: Anton Nefedov --- block/io.c | 27 +++ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/block/io.c b/block/io.c index 04d495e..0a7a372 100644 --- a/block/io.c +++ b/block

[Qemu-block] [PATCH v4 02/15] blkverify: set supported write/zero flags

2017-08-01 Thread Anton Nefedov
Signed-off-by: Anton Nefedov --- block/blkverify.c | 9 + 1 file changed, 9 insertions(+) diff --git a/block/blkverify.c b/block/blkverify.c index 06369f9..9ba65d0 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -140,6 +140,15 @@ static int blkverify_open(BlockDriverState *bs

[Qemu-block] [PATCH v4 03/15] block: introduce BDRV_REQ_ALLOCATE flag

2017-08-01 Thread Anton Nefedov
The flag is supposed to indicate that the region of the disk image has to be sufficiently allocated so it reads as zeroes. The call with the flag set has to return -ENOTSUP if allocation cannot be done efficiently (i.e. without falling back to writing actual buffers) Signed-off-by: Anton Nefedov

[Qemu-block] [PATCH v4 11/15] qcow2: move is_zero() up

2017-08-01 Thread Anton Nefedov
To be used in the following commit without a forward declaration. Signed-off-by: Anton Nefedov --- block/qcow2.c | 45 ++--- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index f522ba9..2ec8b03 100644 --- a

[Qemu-block] [PATCH v4 13/15] qcow2: allocate image space by-cluster

2017-08-01 Thread Anton Nefedov
uster-alignment areas that were not really COWed are now detected as zeroes, hence the initial write has to be exactly the same size for the maps to match Signed-off-by: Anton Nefedov --- block/qcow2.c | 22 +- tests/qemu-iotests/060 | 2 +- tests/qemu-iotest

[Qemu-block] [PATCH v4 10/15] qcow2: check space leak at the end of the image

2017-08-01 Thread Anton Nefedov
From: Pavel Butsykin Preallocated space in the image may remain unused; the patch adds the functionality to identify and fix it in the qcow2_check to avoid wasting storage space on the host. Signed-off-by: Pavel Butsykin Signed-off-by: Denis V. Lunev Signed-off-by: Anton Nefedov --- block

  1   2   3   4   >