* [Qemu-devel] [PATCH for-2.12] commit/stream: Reset delay_ns
@ 2018-04-10 8:58 Kevin Wolf
2018-04-10 12:53 ` Eric Blake
2018-04-11 1:47 ` Stefan Hajnoczi
0 siblings, 2 replies; 3+ messages in thread
From: Kevin Wolf @ 2018-04-10 8:58 UTC (permalink / raw)
To: qemu-block; +Cc: kwolf, stefanha, qemu-devel
Streaming and the commit block job only want to apply throttling when
they actually copied data instead of skipping it, so they made the
calculation of delay_ns conditional. However, delay_ns isn't reset when
skipping some sectors, so instead of not waiting, the old delay is
applied again.
Properly reset delay_ns where needed.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/commit.c | 2 ++
block/stream.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/block/commit.c b/block/commit.c
index ab4fa3c3cf..1432baeef4 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -202,6 +202,8 @@ static void coroutine_fn commit_run(void *opaque)
if (copy && s->common.speed) {
delay_ns = ratelimit_calculate_delay(&s->limit, n);
+ } else {
+ delay_ns = 0;
}
}
diff --git a/block/stream.c b/block/stream.c
index f3b53f49e2..1a85708fcf 100644
--- a/block/stream.c
+++ b/block/stream.c
@@ -188,6 +188,8 @@ static void coroutine_fn stream_run(void *opaque)
s->common.offset += n;
if (copy && s->common.speed) {
delay_ns = ratelimit_calculate_delay(&s->limit, n);
+ } else {
+ delay_ns = 0;
}
}
--
2.13.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH for-2.12] commit/stream: Reset delay_ns
2018-04-10 8:58 [Qemu-devel] [PATCH for-2.12] commit/stream: Reset delay_ns Kevin Wolf
@ 2018-04-10 12:53 ` Eric Blake
2018-04-11 1:47 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Eric Blake @ 2018-04-10 12:53 UTC (permalink / raw)
To: Kevin Wolf, qemu-block; +Cc: qemu-devel, stefanha
[-- Attachment #1: Type: text/plain, Size: 723 bytes --]
On 04/10/2018 03:58 AM, Kevin Wolf wrote:
> Streaming and the commit block job only want to apply throttling when
> they actually copied data instead of skipping it, so they made the
> calculation of delay_ns conditional. However, delay_ns isn't reset when
> skipping some sectors, so instead of not waiting, the old delay is
> applied again.
>
> Properly reset delay_ns where needed.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> block/commit.c | 2 ++
> block/stream.c | 2 ++
> 2 files changed, 4 insertions(+)
>
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH for-2.12] commit/stream: Reset delay_ns
2018-04-10 8:58 [Qemu-devel] [PATCH for-2.12] commit/stream: Reset delay_ns Kevin Wolf
2018-04-10 12:53 ` Eric Blake
@ 2018-04-11 1:47 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2018-04-11 1:47 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-block, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 614 bytes --]
On Tue, Apr 10, 2018 at 10:58:09AM +0200, Kevin Wolf wrote:
> Streaming and the commit block job only want to apply throttling when
> they actually copied data instead of skipping it, so they made the
> calculation of delay_ns conditional. However, delay_ns isn't reset when
> skipping some sectors, so instead of not waiting, the old delay is
> applied again.
>
> Properly reset delay_ns where needed.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> block/commit.c | 2 ++
> block/stream.c | 2 ++
> 2 files changed, 4 insertions(+)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-04-11 1:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-10 8:58 [Qemu-devel] [PATCH for-2.12] commit/stream: Reset delay_ns Kevin Wolf
2018-04-10 12:53 ` Eric Blake
2018-04-11 1:47 ` Stefan Hajnoczi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.