Re: [PATCH v4 00/10] Further bitmaps improvements

2020-03-05 Thread Vladimir Sementsov-Ogievskiy
26.02.2020 16:13, Max Reitz wrote: On 05.02.20 12:20, Vladimir Sementsov-Ogievskiy wrote: Hi! The main feature here is improvement of _next_dirty_area API, which I'm going to use then for backup / block-copy. Somehow, I thought that it was merged, but seems I even forgot to send v4. The

Re: [PATCH v4 08/10] nbd/server: introduce NBDExtentArray

2020-03-05 Thread Vladimir Sementsov-Ogievskiy
27.02.2020 16:21, Eric Blake wrote: On 2/27/20 6:46 AM, Vladimir Sementsov-Ogievskiy wrote: 26.02.2020 18:06, Eric Blake wrote: On 2/5/20 5:20 AM, Vladimir Sementsov-Ogievskiy wrote: Introduce NBDExtentArray class, to handle extents list creation in more controlled way and with fewer OUT

[PATCH v3 9/9] block/block-copy: hide structure definitions

2020-03-05 Thread Vladimir Sementsov-Ogievskiy
Hide structure definitions and add explicit API instead, to keep an eye on the scope of the shared fields. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block-copy.h | 52 +++ block/backup-top.c | 6 ++-- block/backup.c | 25

[PATCH v3 2/9] block/block-copy: fix progress calculation

2020-03-05 Thread Vladimir Sementsov-Ogievskiy
Assume we have two regions, A and B, and region B is in-flight now, region A is not yet touched, but it is unallocated and should be skipped. Correspondingly, as progress we have total = A + B current = 0 If we reset unallocated region A and call progress_reset_callback, it will calculate 0

[PATCH v3 6/9] block/block-copy: refactor interfaces to use bytes instead of end

2020-03-05 Thread Vladimir Sementsov-Ogievskiy
We have a lot of "chunk_end - start" invocations, let's switch to bytes/cur_bytes scheme instead. While being here, improve check on block_copy_do_copy parameters to not overflow when calculating nbytes and use int64_t for bytes in block_copy for consistency. Signed-off-by: Vladimir

[PATCH v3 8/9] block/block-copy: reduce intersecting request lock

2020-03-05 Thread Vladimir Sementsov-Ogievskiy
Currently, block_copy operation lock the whole requested region. But there is no reason to lock clusters, which are already copied, it will disturb other parallel block_copy requests for no reason. Let's instead do the following: Lock only sub-region, which we are going to operate on. Then,

[PATCH v3 1/9] job: refactor progress to separate object

2020-03-05 Thread Vladimir Sementsov-Ogievskiy
We need it in separate to pass to the block-copy object in the next commit. Cc: qemu-sta...@nongnu.org Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Andrey Shinkevich --- include/qemu/job.h| 11 ++- include/qemu/progress_meter.h | 58

[PATCH v3 4/9] block/block-copy: use block_status

2020-03-05 Thread Vladimir Sementsov-Ogievskiy
Use bdrv_block_status_above to chose effective chunk size and to handle zeroes effectively. This substitutes checking for just being allocated or not, and drops old code path for it. Assistance by backup job is dropped too, as caching block-status information is more difficult than just caching

[PATCH v3 3/9] block/block-copy: specialcase first copy_range request

2020-03-05 Thread Vladimir Sementsov-Ogievskiy
In block_copy_do_copy we fallback to read+write if copy_range failed. In this case copy_size is larger than defined for buffered IO, and there is corresponding commit. Still, backup copies data cluster by cluster, and most of requests are limited to one cluster anyway, so the only source of this

[PATCH v3 5/9] block/block-copy: factor out find_conflicting_inflight_req

2020-03-05 Thread Vladimir Sementsov-Ogievskiy
Split find_conflicting_inflight_req to be used separately. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Andrey Shinkevich --- block/block-copy.c | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/block/block-copy.c

[PATCH v3 0/9] block-copy improvements: part I

2020-03-05 Thread Vladimir Sementsov-Ogievskiy
v3: 01: new 03: fix block_copy_do_copy 04: add comment, rebase on 01 05: s/block_copy_find_inflight_req/find_conflicting_inflight_req/ 06: add overflow check use int64_t for block_copy bytes parameter fix preexisting typo in modified comment 07: update forgotten block_copy prototype

[PATCH v3 7/9] block/block-copy: rename start to offset in interfaces

2020-03-05 Thread Vladimir Sementsov-Ogievskiy
offset/bytes pair is more usual naming in block layer, let's use it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Andrey Shinkevich Reviewed-by: Max Reitz --- include/block/block-copy.h | 4 +- block/block-copy.c | 84 +++--- 2 files

Re: [PATCH 2/2] via-ide: Also emulate non 100% native mode

2020-03-05 Thread Mark Cave-Ayland
On 06/03/2020 00:21, BALATON Zoltan wrote: > On Fri, 6 Mar 2020, BALATON Zoltan wrote: >> On Thu, 5 Mar 2020, Mark Cave-Ayland wrote: >>> On 04/03/2020 22:33, BALATON Zoltan wrote: >>> another possibility: PCI configuration space register 0x3d (Interrupt pin) >>> is >>> documented as having

Re: [PATCH v4 1/4] qapi: Add a 'coroutine' flag for commands

2020-03-05 Thread Markus Armbruster
Kevin Wolf writes: > Am 05.03.2020 um 16:30 hat Markus Armbruster geschrieben: >> Kevin Wolf writes: >> >> > Am 22.01.2020 um 07:32 hat Markus Armbruster geschrieben: >> >> Kevin Wolf writes: >> >> >> >> > This patch adds a new 'coroutine' flag to QMP command definitions that >> >> > tells

Re: [PATCH 2/2] via-ide: Also emulate non 100% native mode

2020-03-05 Thread Mark Cave-Ayland
On 05/03/2020 23:35, BALATON Zoltan wrote: >> I just a quick look at the PCI specification and found this interesting >> paragraph in >> the section about "Interrupt Line": >> >> >> "The Interrupt Line register is an eight-bit register used to communicate >> interrupt >> line routing

[PATCH v8 09/10] nbd: introduce ERRP_AUTO_PROPAGATE

2020-03-05 Thread Vladimir Sementsov-Ogievskiy
If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == _fatal (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. If we want to

[PATCH v8 10/10] xen: introduce ERRP_AUTO_PROPAGATE

2020-03-05 Thread Vladimir Sementsov-Ogievskiy
If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == _fatal (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. If we want to

[PATCH v8 00/10] error: auto propagated local_err part I

2020-03-05 Thread Vladimir Sementsov-Ogievskiy
File with errp-cleaning APIs dropped for two reasons: 1. I'm tired after a 3-days war with coccinelle, and don't want to add more patches here. 2. Markus noted, that we forget two more functions which needs such wrappers and corresponding conversion, so seems better to handle all these

[PATCH v8 01/10] error: auto propagated local_err

2020-03-05 Thread Vladimir Sementsov-Ogievskiy
Here is introduced ERRP_AUTO_PROPAGATE macro, to be used at start of functions with an errp OUT parameter. It has three goals: 1. Fix issue with error_fatal and error_prepend/error_append_hint: user can't see this additional information, because exit() happens in error_setg earlier than

[PATCH v8 02/10] scripts: add coccinelle script to use auto propagated errp

2020-03-05 Thread Vladimir Sementsov-Ogievskiy
Script adds ERRP_AUTO_PROPAGATE macro invocation where appropriate and does corresponding changes in code (look for details in include/qapi/error.h) Usage example: spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \ --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff \

[PATCH v8 05/10] pflash: introduce ERRP_AUTO_PROPAGATE

2020-03-05 Thread Vladimir Sementsov-Ogievskiy
If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == _fatal (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. If we want to

Re: [PATCH 2/2] via-ide: Also emulate non 100% native mode

2020-03-05 Thread BALATON Zoltan
On Fri, 6 Mar 2020, BALATON Zoltan wrote: On Thu, 5 Mar 2020, Mark Cave-Ayland wrote: On 04/03/2020 22:33, BALATON Zoltan wrote: another possibility: PCI configuration space register 0x3d (Interrupt pin) is documented as having value 0 == Legacy IRQ routing which should be the initial value

Re: [PATCH 2/2] via-ide: Also emulate non 100% native mode

2020-03-05 Thread BALATON Zoltan
On Thu, 5 Mar 2020, Mark Cave-Ayland wrote: On 04/03/2020 22:33, BALATON Zoltan wrote: AFAICT this then only leaves the question: why does the firmware set PCI_INTERRUPT_LINE to 9, which is presumably why you are seeing problems running MorphOS under QEMU. Linux does try to handle both true

Re: [PATCH v2 1/3] iotests: Specify explicit backing format where sensible

2020-03-05 Thread Eric Blake
On 2/27/20 7:08 AM, Eric Blake wrote: The change in libvirt to reject images without explicit backing format has pointed out that a number of tools have been far too reliant on probing in the past.  It's time to set a better example in our own iotests of properly setting this parameter. iotest

Re: [PATCH v5 2/5] qcow2: introduce compression type feature

2020-03-05 Thread Alberto Garcia
On Wed 04 Mar 2020 02:35:35 PM CET, Denis Plotnikov wrote: > +## > +# @Qcow2CompressionType: I realized that we have a bit of a mix in the way we write this type of identifiers between QCow2FooBar (capital C) and Qcow2FooBar ... what's the recommended one? > @@ -146,6 +146,12 @@ typedef struct

Re: [PATCH 2/2] via-ide: Also emulate non 100% native mode

2020-03-05 Thread Mark Cave-Ayland
On 04/03/2020 22:33, BALATON Zoltan wrote: >> AFAICT this then only leaves the question: why does the firmware set >> PCI_INTERRUPT_LINE to 9, which is presumably why you are seeing problems >> running >> MorphOS under QEMU. > > Linux does try to handle both true native

Re: [PATCH v7 06/10] iotests: limit line length to 79 chars

2020-03-05 Thread John Snow
On 3/5/20 6:55 AM, Kevin Wolf wrote: > Am 05.03.2020 um 00:14 hat John Snow geschrieben: >> >> >> On 3/4/20 4:58 PM, Philippe Mathieu-Daudé wrote: > > Adding back the context: > >> -sys.stderr.write('qemu-img received signal %i: %s\n' % (-exitcode, >> ' '.join(qemu_img_args +

Re: [PATCH 7/7] aio-posix: remove idle poll handlers to improve scalability

2020-03-05 Thread Paolo Bonzini
On 05/03/20 18:08, Stefan Hajnoczi wrote: > +/* > + * List of handlers participating in userspace polling. Accessed almost > + * exclusively from aio_poll() and therefore not an RCU list. Protected > by > + * ctx->list_lock. > + */ > +AioHandlerList poll_aio_handlers; >

[PATCH 1/7] aio-posix: completely stop polling when disabled

2020-03-05 Thread Stefan Hajnoczi
One iteration of polling is always performed even when polling is disabled. This is done because: 1. Userspace polling is cheaper than making a syscall. We might get lucky. 2. We must poll once more after polling has stopped in case an event occurred while stopping polling. However, there

[PATCH 0/7] aio-posix: polling scalability improvements

2020-03-05 Thread Stefan Hajnoczi
A guest with 100 virtio-blk-pci,num-queues=32 devices only reaches 10k IOPS while a guest with a single device reaches 105k IOPS (rw=randread,bs=4k,iodepth=1,ioengine=libaio). The bottleneck is that aio_poll() userspace polling iterates over all AioHandlers to invoke their ->io_poll() callbacks.

Re: [PATCH 2/7] aio-posix: move RCU_READ_LOCK() into run_poll_handlers()

2020-03-05 Thread Paolo Bonzini
On 05/03/20 18:08, Stefan Hajnoczi wrote: > > +/* > + * Optimization: ->io_poll() handlers often contain RCU read critical > + * sections and we therefore see many rcu_read_lock() -> > rcu_read_unlock() > + * -> rcu_read_lock() -> ... sequences with expensive memory > + *

[PATCH 6/7] aio-posix: support userspace polling of fd monitoring

2020-03-05 Thread Stefan Hajnoczi
Unlike ppoll(2) and epoll(7), Linux io_uring completions can be polled from userspace. Previously userspace polling was only allowed when all AioHandler's had an ->io_poll() callback. This prevented starvation of fds by userspace pollable handlers. Add the FDMonOps->need_wait() callback that

[PATCH 5/7] aio-posix: add io_uring fd monitoring implementation

2020-03-05 Thread Stefan Hajnoczi
The recent Linux io_uring API has several advantages over ppoll(2) and epoll(2). Details are given in the source code. Add an io_uring implementation and make it the default on Linux. Performance is the same as with epoll(7) but later patches add optimizations that take advantage of io_uring.

[PATCH 2/7] aio-posix: move RCU_READ_LOCK() into run_poll_handlers()

2020-03-05 Thread Stefan Hajnoczi
Now that run_poll_handlers_once() is only called by run_poll_handlers() we can improve the CPU time profile by moving the expensive RCU_READ_LOCK() out of the polling loop. This reduces the run_poll_handlers() from 40% CPU to 10% CPU in perf's sampling profiler output. Signed-off-by: Stefan

[PATCH 4/7] aio-posix: simplify FDMonOps->update() prototype

2020-03-05 Thread Stefan Hajnoczi
The AioHandler *node, bool is_new arguments are more complicated to think about than simply being given AioHandler *old_node, AioHandler *new_node. Furthermore, the new Linux io_uring file descriptor monitoring mechanism added by the new patch requires access to both the old and the new nodes.

[PATCH 3/7] aio-posix: extract ppoll(2) and epoll(7) fd monitoring

2020-03-05 Thread Stefan Hajnoczi
The ppoll(2) and epoll(7) file descriptor monitoring implementations are mixed with the core util/aio-posix.c code. Before adding another implementation for Linux io_uring, extract out the existing ones so there is a clear interface and the core code is simpler. The new interface is

[PATCH 7/7] aio-posix: remove idle poll handlers to improve scalability

2020-03-05 Thread Stefan Hajnoczi
When there are many poll handlers it's likely that some of them are idle most of the time. Remove handlers that haven't had activity recently so that the polling loop scales better for guests with a large number of devices. This feature only takes effect for the Linux io_uring fd monitoring

Re: [PATCH v4 1/4] qapi: Add a 'coroutine' flag for commands

2020-03-05 Thread Kevin Wolf
Am 05.03.2020 um 16:30 hat Markus Armbruster geschrieben: > Kevin Wolf writes: > > > Am 22.01.2020 um 07:32 hat Markus Armbruster geschrieben: > >> Kevin Wolf writes: > >> > >> > This patch adds a new 'coroutine' flag to QMP command definitions that > >> > tells the QMP dispatcher that the

Re: [PATCH 2/2] block: bdrv_reopen() with backing file in different AioContext

2020-03-05 Thread Alberto Garcia
On Thu 27 Feb 2020 07:18:04 PM CET, Kevin Wolf wrote: > /* > - * TODO: before removing the x- prefix from x-blockdev-reopen we > - * should move the new backing file into the right AioContext > - * instead of returning an error. > + * Check AioContext compatibility so that the

Re: [PATCH v4 1/4] qapi: Add a 'coroutine' flag for commands

2020-03-05 Thread Markus Armbruster
Kevin Wolf writes: > Am 22.01.2020 um 07:32 hat Markus Armbruster geschrieben: >> Kevin Wolf writes: >> >> > This patch adds a new 'coroutine' flag to QMP command definitions that >> > tells the QMP dispatcher that the command handler is safe to be run in a >> > coroutine. >> >> I'm afraid I

Re: [PATCH 0/4] block: Relax restrictions for blockdev-snapshot

2020-03-05 Thread Peter Krempa
On Thu, Mar 05, 2020 at 13:50:56 +0100, Kevin Wolf wrote: > This series allows libvirt to fix a regression that its switch from > drive-mirror to blockdev-mirror caused: It currently requires that the > backing chain of the target image is already available when the mirror > operation is started.

Re: [PATCH 0/4] block: Relax restrictions for blockdev-snapshot

2020-03-05 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200305125100.386-1-kw...@redhat.com/ Hi, This series failed the docker-mingw@fedora build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT BEGIN === #!

Re: [PATCH 0/4] block: Relax restrictions for blockdev-snapshot

2020-03-05 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200305125100.386-1-kw...@redhat.com/ Hi, This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT BEGIN ===

[PATCH 3/4] iotests: Fix run_job() with use_log=False

2020-03-05 Thread Kevin Wolf
The 'job-complete' QMP command should be run with qmp() rather than qmp_log() if use_log=False is passed. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/iotests.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/iotests.py

[PATCH 4/4] iotests: Test mirror with temporarily disabled target backing file

2020-03-05 Thread Kevin Wolf
The newly tested scenario is a common live storage migration scenario: The target node is opened without a backing file so that the active layer is mirrored while its backing chain can be copied in the background. The backing chain should be attached to the mirror target node when finalising the

[PATCH 2/4] block: Relax restrictions for blockdev-snapshot

2020-03-05 Thread Kevin Wolf
blockdev-snapshot returned an error if the overlay was already in use, which it defined as having any BlockBackend parent. This is in fact both too strict (some parents can tolerate the change of visible data caused by attaching a backing file) and too loose (some non-BlockBackend parents may not

[PATCH 1/4] block: Make bdrv_get_cumulative_perm() public

2020-03-05 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- include/block/block_int.h | 3 +++ block.c | 6 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index f422c0bff0..71164c4ee1 100644 --- a/include/block/block_int.h +++

[PATCH 0/4] block: Relax restrictions for blockdev-snapshot

2020-03-05 Thread Kevin Wolf
This series allows libvirt to fix a regression that its switch from drive-mirror to blockdev-mirror caused: It currently requires that the backing chain of the target image is already available when the mirror operation is started. In reality, the backing chain may only be copied while the

Re: QAPI schema for desired state of LUKS keyslots (was: [PATCH 02/13] qcrypto-luks: implement encryption key management)

2020-03-05 Thread Maxim Levitsky
On Tue, 2020-03-03 at 11:18 +0200, Maxim Levitsky wrote: > On Sat, 2020-02-15 at 15:51 +0100, Markus Armbruster wrote: > > Review of this patch led to a lengthy QAPI schema design discussion. > > Let me try to condense it into a concrete proposal. > > > > This is about the QAPI schema, and

Re: [PATCH v5 4/5] qcow2: add zstd cluster compression

2020-03-05 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > 04.03.2020 16:35, Denis Plotnikov wrote: >> zstd significantly reduces cluster compression time. >> It provides better compression performance maintaining >> the same level of the compression ratio in comparison with >> zlib, which, at the moment, is the

Re: [PATCH v7 06/10] iotests: limit line length to 79 chars

2020-03-05 Thread Kevin Wolf
Am 05.03.2020 um 00:14 hat John Snow geschrieben: > > > On 3/4/20 4:58 PM, Philippe Mathieu-Daudé wrote: Adding back the context: > -sys.stderr.write('qemu-img received signal %i: %s\n' % (-exitcode, ' > '.join(qemu_img_args + list(args > +sys.stderr.write('qemu-img

Re: [PATCH v5 4/5] qcow2: add zstd cluster compression

2020-03-05 Thread Vladimir Sementsov-Ogievskiy
04.03.2020 16:35, Denis Plotnikov wrote: zstd significantly reduces cluster compression time. It provides better compression performance maintaining the same level of the compression ratio in comparison with zlib, which, at the moment, is the only compression method available. The performance