[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 5/7] block/commit: use block_job_throttle
From: |
John Snow |
Subject: |
[Qemu-devel] [PATCH 5/7] block/commit: use block_job_throttle |
Date: |
Wed, 13 Dec 2017 19:59:51 -0500 |
Depending on the value of `speed` and how fast our backends are,
delay_ns might be 0 very, very often. This creates some warning
messages that spook users, but it's also pretty inefficient.
Use block_job_throttle instead to yield a little more intelligently.
Signed-off-by: John Snow <address@hidden>
---
block/commit.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block/commit.c b/block/commit.c
index 873e749d50..567064215b 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -172,7 +172,8 @@ static void coroutine_fn commit_run(void *opaque)
/* Note that even when no rate limit is applied we need to yield
* with no pending I/O here so that bdrv_drain_all() returns.
*/
- block_job_sleep_ns(&s->common, delay_ns);
+ block_job_throttle(&s->common, delay_ns);
+
if (block_job_is_cancelled(&s->common)) {
break;
}
--
2.14.3
- [Qemu-devel] [PATCH 3/7] blockjob: create block_job_throttle, (continued)