Re: [RFC PATCH v1 2/7] char-socket: return -1 in case of disconnect during tcp_chr_write

2020-04-24 Thread Anton Nefedov
> On Thu, Apr 23, 2020 at 8:43 PM Dima Stepanov wrote: >> The problem is that vhost_user_write doesn't get an error after >> disconnect and try to call vhost_user_read(). The tcp_chr_write() >> routine should return -1 in case of disconnect. Indicate the EIO error >> if this routine is called in

Re: Problems with c8bb23cbdbe3 on ppc64le

2019-10-10 Thread Anton Nefedov
On 10/10/2019 6:17 PM, Max Reitz wrote: > Hi everyone, > > (CCs just based on tags in the commit in question) > > I have two bug reports which claim problems of qcow2 on XFS on ppc64le > machines since qemu 4.1.0. One of those is about bad performance > (sorry, is isn’t public :-/), the other

Re: [PATCH v9 0/9] discard blockstats

2019-09-23 Thread Anton Nefedov
On 23/9/2019 1:59 PM, Max Reitz wrote: > On 06.09.19 18:01, Anton Nefedov wrote: >> v9: >> - fixed patch 5 so the fields are actually numbered in sectors not blocks >> - fixed patch 7 accordingly >> - patch 8: make stat fields unsigned >> - qapi patches: &q

[PATCH v10 2/9] qapi: add unmap to BlockDeviceStats

2019-09-23 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

[PATCH v10 7/9] scsi: account unmap operations

2019-09-23 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 a002fdabe8..68b1675fd9 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi

[PATCH v10 0/9] discard blockstats

2019-09-23 Thread Anton Nefedov
_operations": 0, "rd_operations": 4816, "account_failed": true, > "unmap_merged": 0, "wr_total_time_ns": 1262686124, "invalid_rd_operations": 0 }, "parent": { >

[PATCH v10 1/9] qapi: group BlockDeviceStats fields

2019-09-23 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

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

2019-09-23 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 Reviewed-by: Vladimir Sementsov-Ogievskiy Acked-by: Markus Armbruster --- qapi/block-core.json | 38

[PATCH v10 5/9] scsi: store unmap offset and nb_sectors in request struct

2019-09-23 Thread Anton Nefedov
it allows to report it in the error handler Signed-off-by: Anton Nefedov --- hw/scsi/scsi-disk.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 915641a0f1..b3dd21800d 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw

[PATCH v10 3/9] block: add empty account cookie type

2019-09-23 Thread Anton Nefedov
de code where it's hard to keep track whether the request done its accounting or not: in the following patch of the series, trim requests will do the accounting separately. Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy --- include/block/accounting.h | 1 + block

[PATCH v10 8/9] file-posix: account discard operations

2019-09-23 Thread Anton Nefedov
that these 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 | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file

[PATCH v10 6/9] scsi: move unmap error checking to the complete callback

2019-09-23 Thread Anton Nefedov
() 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-disk.c b/hw

[PATCH v10 4/9] ide: account UNMAP (TRIM) operations

2019-09-23 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 e6e54c6c9a..754ff4dc34 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -442,6 +442,14 @@ static void

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

2019-09-10 Thread Anton Nefedov
On 9/9/2019 5:54 PM, Alberto Garcia wrote: > On Fri 06 Sep 2019 06:01:14 PM CEST, Anton Nefedov wrote: >> This adds some protection from accounting uninitialized cookie. >> That is, block_acct_failed/done without previous block_acct_start; >> in that case, cookie proba

[Qemu-devel] [PATCH v9 7/9] scsi: account unmap operations

2019-09-06 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 a002fdabe8..68b1675fd9 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -1617,10 +1617,16 @@ static

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

2019-09-06 Thread Anton Nefedov
ng separately. Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy --- 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..878b

[Qemu-devel] [PATCH v9 2/9] qapi: add unmap to BlockDeviceStats

2019-09-06 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-devel] [PATCH v9 6/9] scsi: move unmap error checking to the complete callback

2019-09-06 Thread Anton Nefedov
() 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-disk.c b/hw

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

2019-09-06 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 e6e54c6c9a..754ff4dc34 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -442,6 +442,14 @@ static void

[Qemu-devel] [PATCH v9 0/9] discard blockstats

2019-09-06 Thread Anton Nefedov
"unmap_merged": 0, "wr_total_time_ns": 1262686124, "invalid_rd_operations": 0 }, "parent": { > "driver-specific": { > "discard-nb-failed": 0, > "discard-bytes-ok": 720896, > "

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

2019-09-06 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 Reviewed-by: Vladimir Sementsov-Ogievskiy Acked-by: Markus Armbruster --- qapi/block-core.json | 38

[Qemu-devel] [PATCH v9 8/9] file-posix: account discard operations

2019-09-06 Thread Anton Nefedov
that these 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 | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file

[Qemu-devel] [PATCH v9 1/9] qapi: group BlockDeviceStats fields

2019-09-06 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-devel] [PATCH v9 5/9] scsi: store unmap offset and nb_sectors in request struct

2019-09-06 Thread Anton Nefedov
it allows to report it in the error handler Signed-off-by: Anton Nefedov --- hw/scsi/scsi-disk.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 915641a0f1..b3dd21800d 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw

Re: [Qemu-devel] [PATCH 0/2] block/file-posix: Fix xfs_write_zeroes()

2019-08-23 Thread Anton Nefedov
+++ > tests/qemu-iotests/265.out | 6 > tests/qemu-iotests/group | 1 + > 4 files changed, 85 insertions(+), 5 deletions(-) > create mode 100755 tests/qemu-iotests/265 > create mode 100644 tests/qemu-iotests/265.out > Nice! thanks Max Reviewed-by: Anton Nefedov

Re: [Qemu-devel] Broken aarch64 by qcow2: skip writing zero buffers to empty COW areas [v2]

2019-08-21 Thread Anton Nefedov
On 21/8/2019 5:14 PM, Lukáš Doktor wrote: > Hello guys, > > First attempt was rejected due to zip attachment, let's try it again with > just Avocado-vt debug.log and serial console log files attached. > > I bisected a regression on aarch64 all the way to this commit: "qcow2: skip > writing

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

2019-08-21 Thread Anton Nefedov
On 21/8/2019 2:21 PM, Max Reitz wrote: > On 21.08.19 13:00, Anton Nefedov wrote: >> On 12/8/2019 10:04 PM, Max Reitz wrote: >>> On 16.05.19 16:33, Anton Nefedov wrote: >>>> A block driver can provide a callback to report driver-specific >>>> statistic

Re: [Qemu-devel] [PATCH v8 4/9] ide: account UNMAP (TRIM) operations

2019-08-21 Thread Anton Nefedov
On 12/8/2019 9:16 PM, Max Reitz wrote: > On 16.05.19 16:33, Anton Nefedov wrote: >> Signed-off-by: Anton Nefedov >> Reviewed-by: Vladimir Sementsov-Ogievskiy >> --- >> hw/ide/core.c | 12 >> 1 file changed, 12 insertions(+) >> >&g

Re: [Qemu-devel] [PATCH v8 5/9] scsi: store unmap offset and nb_sectors in request struct

2019-08-21 Thread Anton Nefedov
On 12/8/2019 8:58 PM, Max Reitz wrote: > On 16.05.19 16:33, Anton Nefedov wrote: >> it allows to report it in the error handler >> >> Signed-off-by: Anton Nefedov >> Reviewed-by: Vladimir Sementsov-Ogievskiy >> Reviewed-by: Alberto Garcia >> --- >>

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

2019-08-21 Thread Anton Nefedov
On 12/8/2019 10:04 PM, Max Reitz wrote: > On 16.05.19 16:33, 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: Anton Nefe

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

2019-06-04 Thread Anton Nefedov
On 3/6/2019 1:09 PM, Stefano Garzarella wrote: > On Tue, May 14, 2019 at 12:10:40PM +0000, Anton Nefedov wrote: >> hi, >> >> yet another take for this patch series; please kindly consider these for 4.1 >> >> Just a few cosmetic comments were received for v6 s

Re: [Qemu-devel] [RFC 1/3] block: Add ImageRotationalInfo

2019-05-27 Thread Anton Nefedov
On 27/5/2019 3:57 PM, Max Reitz wrote: > On 27.05.19 14:37, Alberto Garcia wrote: >> On Mon 27 May 2019 02:16:53 PM CEST, Max Reitz wrote: >>> On 26.05.19 17:08, Alberto Garcia wrote: On Fri 24 May 2019 07:28:10 PM CEST, Max Reitz wrote: > +## > +# @ImageRotationalInfo: > +#

Re: [Qemu-devel] [PATCH v14 1/1] qcow2: skip writing zero buffers to empty COW areas

2019-05-23 Thread Anton Nefedov
On 22/5/2019 11:40 PM, Max Reitz wrote: > On 16.05.19 16:27, Anton Nefedov wrote: >> If COW areas of the newly allocated clusters are zeroes on the backing >> image, efficient bdrv_write_zeroes(flags=BDRV_REQ_NO_FALLBACK) can be >> used on the whole cluster instead of writing

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

2019-05-16 Thread Anton Nefedov
On 16/5/2019 6:34 PM, Vladimir Sementsov-Ogievskiy wrote: > 16.05.2019 17:33, Anton Nefedov wrote: >> This adds some protection from accounting uninitialized cookie. >> That is, block_acct_failed/done without previous block_acct_start; >> in that case, cookie probably holds

[Qemu-devel] [PATCH v8 0/9] discard blockstats

2019-05-16 Thread Anton Nefedov
"wr_operations": 143, "failed_wr_operations": 0, "rd_operations": 4816, "account_failed": true, > "unmap_merged": 0, "wr_total_time_ns": 1262686124, "invalid_rd_operations": 0 }, &quo

[Qemu-devel] [PATCH v8 2/9] qapi: add unmap to BlockDeviceStats

2019-05-16 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-devel] [PATCH v8 5/9] scsi: store unmap offset and nb_sectors in request struct

2019-05-16 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-devel] [PATCH v8 9/9] qapi: query-blockstat: add driver specific file-posix stats

2019-05-16 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 Reviewed-by: Vladimir Sementsov-Ogievskiy Acked-by: Markus Armbruster --- qapi/block-core.json | 38

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

2019-05-16 Thread Anton Nefedov
ng 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 +++ b/

[Qemu-devel] [PATCH v8 1/9] qapi: group BlockDeviceStats fields

2019-05-16 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-devel] [PATCH v2] iotest 134: test cluster-misaligned encrypted write

2019-05-16 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 --- ..apparently v1 ended up in a weird base64 that would not easily git-am. Resending. used to be a part of 'qcow2: cluster space

[Qemu-devel] [PATCH v14 0/1] qcow2: cluster space preallocation

2019-05-16 Thread Anton Nefedov
| 112.676 | 122.056 | -8% | +---+--+--+--+ Anton Nefedov (1): qcow2: skip writing zero buffers to empty COW areas qapi/block-core.json | 4 +- block/qcow2.h | 6 +++ block/qcow2-cluster.c | 2 +- block/qcow2.c

[Qemu-devel] [PATCH v8 8/9] file-posix: account discard operations

2019-05-16 Thread Anton Nefedov
that these numbers will not include discards triggered by write-zeroes + MAY_UNMAP calls. Signed-off-by: Anton Nefedov --- block/file-posix.c | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index 1cf4ee49eb..76d54b3a85 100644

[Qemu-devel] [PATCH v8 7/9] scsi: account unmap operations

2019-05-16 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 6eff496b54..5c77981d60 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi

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

2019-05-16 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 6afadf894f..3a7ac93777 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -441,6 +441,14 @@ static void

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

2019-05-16 Thread Anton Nefedov
() 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-disk.c b/hw

[Qemu-devel] [PATCH v14 1/1] qcow2: skip writing zero buffers to empty COW areas

2019-05-16 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 | 93 +- block/trace-events | 1 + tests/qemu

[Qemu-devel] [PATCH] iotest 134: test cluster-misaligned encrypted write

2019-05-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 --- used to be a part of 'qcow2: cluster space preallocation' series http://lists.nongnu.org/archive/html/qemu-devel/2019-01/msg02769.html

[Qemu-devel] [PATCH v13 1/1] qcow2: skip writing zero buffers to empty COW areas

2019-05-14 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 | 93 +- block/trace-events | 1 + tests/qemu

[Qemu-devel] [PATCH v13 0/1] qcow2: cluster space preallocation

2019-05-14 Thread Anton Nefedov
esults (seconds): +---+---+--+---+--+--+ | file|before| after| gain | +---+---+--+---+--+--+ |ssd| 61.153 | 36.313 | 41% | |hdd| 112.676 | 122.056 | -8% | +---+--+--+--+ A

[Qemu-devel] [PATCH v7 8/9] file-posix: account discard operations

2019-05-14 Thread Anton Nefedov
that these numbers will not include discards triggered by write-zeroes + MAY_UNMAP calls. Signed-off-by: Anton Nefedov --- block/file-posix.c | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index 1cf4ee49eb..76d54b3a85 100644

[Qemu-devel] [PATCH v7 7/9] scsi: account unmap operations

2019-05-14 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 6eff496b54..5c77981d60 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi

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

2019-05-14 Thread Anton Nefedov
() 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-disk.c b/hw

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

2019-05-14 Thread Anton Nefedov
ng 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 +++ b/

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

2019-05-14 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 Reviewed-by: Vladimir Sementsov-Ogievskiy Acked-by: Markus Armbruster --- qapi/block-core.json | 38

[Qemu-devel] [PATCH v7 2/9] qapi: add unmap to BlockDeviceStats

2019-05-14 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-devel] [PATCH v7 0/9] discard blockstats

2019-05-14 Thread Anton Nefedov
rations": 4816, "account_failed": true, > "unmap_merged": 0, "wr_total_time_ns": 1262686124, "invalid_rd_operations": 0 }, "parent": { > "driver-specific": { > "discard-nb-

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

2019-05-14 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-devel] [PATCH v7 4/9] ide: account UNMAP (TRIM) operations

2019-05-14 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 6afadf894f..3a7ac93777 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -441,6 +441,14 @@ static void

[Qemu-devel] [PATCH v7 1/9] qapi: group BlockDeviceStats fields

2019-05-14 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

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

2019-02-21 Thread Anton Nefedov
On 14/1/2019 2:18 PM, Anton Nefedov wrote: > This pull request is to start to improve a few performance points of > qcow2 format: > >1. non cluster-aligned write requests (to unallocated clusters) explicitly > pad data with zeroes if there is no backing data. >

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

2019-02-21 Thread Anton Nefedov
On 14/1/2019 4:16 PM, Anton Nefedov wrote: > 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. >> Disc

Re: [Qemu-devel] [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-devel] [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

[Qemu-devel] [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

[Qemu-devel] [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-devel] [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-devel] [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

[Qemu-devel] [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 Garcia

[Qemu-devel] [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-devel] [PATCH v12 04/10] block: introduce BDRV_REQ_ALLOCATE flag

2019-01-14 Thread Anton Nefedov
- and 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-devel] [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-devel] [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-devel] [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-devel] [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

Re: [Qemu-devel] [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-devel] [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

[Qemu-devel] [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-devel] [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-devel] [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-devel] [PATCH v11 06/10] file-posix: reset fallocate-related flags without CONFIG_FALLOCATE*

2018-12-18 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 changed, 6

[Qemu-devel] [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-devel] [PATCH v11 04/10] block: introduce BDRV_REQ_ALLOCATE flag

2018-12-18 Thread Anton Nefedov
- and 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-devel] [PATCH v11 07/10] file-posix: support BDRV_REQ_ALLOCATE

2018-12-17 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-devel] [PATCH v11 00/10] qcow2: cluster space preallocation

2018-12-17 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-devel] [PATCH v11 03/10] quorum: set supported write flags

2018-12-17 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-devel] [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

Re: [Qemu-devel] [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

Re: [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 statistic

Re: [Qemu-devel] [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-devel] [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-devel] [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-devel] [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-devel] [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-devel] [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-devel] [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-devel] [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-devel] [PATCH v10 1/9] mirror: inherit supported write/zero flags

2018-12-05 Thread Anton Nefedov
series, 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: >> Signed-

Re: [Qemu-devel] [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)

[Qemu-devel] [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

  1   2   3   4   5   >