[pve-devel] [PATCH] mirror sleep : set sleep to SLICE_TIME/10 (10ms)
Alexandre Derumier
aderumier at odiso.com
Thu Jul 2 07:31:58 CEST 2015
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 at odiso.com>
---
debian/patches/mirror-sleep2.patch | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/debian/patches/mirror-sleep2.patch b/debian/patches/mirror-sleep2.patch
index e1b59db..97f4785 100644
--- a/debian/patches/mirror-sleep2.patch
+++ b/debian/patches/mirror-sleep2.patch
@@ -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)) {
--
2.1.4
More information about the pve-devel
mailing list