]> git.proxmox.com Git - pve-qemu-kvm.git/commitdiff
mirror sleep : set sleep to SLICE_TIME/10 (10ms)
authorAlexandre Derumier <aderumier@odiso.com>
Thu, 2 Jul 2015 05:31:58 +0000 (07:31 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 2 Jul 2015 05:38:51 +0000 (07:38 +0200)
Current make too much sleep because

if (now - last_pause_ns > SLICE_TIME) {
         last_pause_ns = now;
         block_job_sleep_ns(&s->common, QEMU_CLOCK_REALTIME, SLICE_TIME);

so, we sleep SLICE_TIME, then at next iteration if lastpause("SLICE_TIME") > SLICE_TIME, we sleep again.
So, it almost always sleep at each iteration.

This patch set the sleep value to  SLICE_TIME/10.

I have benched it, I have very scanning speed without impacting vm performance.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
debian/patches/mirror-sleep2.patch

index e1b59db0799332b6663be72ef819b00b5d1bbd2b..97f4785e0b66cb8d3de6dbd8b0fa2206e912d1aa 100644 (file)
@@ -19,7 +19,7 @@ index 0a05971..2711249 100644
              if (now - last_pause_ns > SLICE_TIME) {
                  last_pause_ns = now;
 -                block_job_sleep_ns(&s->common, QEMU_CLOCK_REALTIME, 0);
-+                block_job_sleep_ns(&s->common, QEMU_CLOCK_REALTIME, SLICE_TIME);
++                block_job_sleep_ns(&s->common, QEMU_CLOCK_REALTIME, SLICE_TIME/10);
              }
  
              if (block_job_is_cancelled(&s->common)) {