diff mbox

[2/3] mirror: Use block_job_relax_cpu during bitmap scanning

Message ID 1436413678-7114-3-git-send-email-famz@redhat.com
State New
Headers show

Commit Message

Fam Zheng July 9, 2015, 3:47 a.m. UTC
Sleeping for 0 second may not be as effective as we want, use
block_job_relax_cpu.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 block/mirror.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefan Hajnoczi July 9, 2015, 1 p.m. UTC | #1
On Thu, Jul 09, 2015 at 11:47:57AM +0800, Fam Zheng wrote:
> Sleeping for 0 second may not be as effective as we want, use
> block_job_relax_cpu.
> 
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  block/mirror.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
diff mbox

Patch

diff --git a/block/mirror.c b/block/mirror.c
index 62db031..ca55578 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -438,7 +438,7 @@  static void coroutine_fn mirror_run(void *opaque)
 
             if (now - last_pause_ns > SLICE_TIME) {
                 last_pause_ns = now;
-                block_job_sleep_ns(&s->common, QEMU_CLOCK_REALTIME, 0);
+                block_job_relax_cpu(&s->common);
             }
 
             if (block_job_is_cancelled(&s->common)) {