Skip to contentSkip to conversation

introduce dirty ring size for guestperf tool

PATCH New [email protected] 1 participant 2 messages Mar 3, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 introduce dirty ring size for guestperf tool

From: Hyman Huang(黄勇) <[email protected]>

v1:
-original version sent by accident, send the right patch

Dirtylimit implementation has been reviewed in the past few months, if things go well, it will be merged in the near future, which is the first step to implement a new live migration feature. For more details refer to:
https://lore.kernel.org/qemu-devel/[email protected]/

The second step is to implement the "dirtylimit" capability of live migration basing on the implementation in first step, and the main logic is almost done, refer to:
https://github.com/newfriday/qemu/commits/migration_dirtylimit_v1

Since "dirtylimit" capability of live migration is basing on dirty ring, so if we want compare live migration used "dirtylimit" capability with other capabilities such as "auto-converge" in performance, set dirty ring size when start vm using guestperf tool is an convenient way.

So let's introduce dirty ring size for guestperf tool.

Hyman Huang (1):
tests/migration: Introduce dirty-ring-size option into guestperf

 tests/migration/guestperf/engine.py   | 6 +++++-
 tests/migration/guestperf/hardware.py | 8 ++++++--
 tests/migration/guestperf/shell.py    | 6 +++++-
 3 files changed, 16 insertions(+), 4 deletions(-)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/1 tests/migration: Introduce dirty-ring-size option into guestperf

From: Hyman Huang(黄勇) <[email protected]>

Guestperf tool does not enable diry ring feature when test migration by default.

To support dirty ring migration performance test, introduce dirty-ring-size option into guestperf tools, which ranges in [1024, 65536].

To set dirty ring size with 4096 during migration test:

$ ./tests/migration/guestperf.py --dirty-ring-size 4096 xxx
---
 tests/migration/guestperf/engine.py   | 6 +++++-
 tests/migration/guestperf/hardware.py | 8 ++++++--
 tests/migration/guestperf/shell.py    | 6 +++++-
 3 files changed, 16 insertions(+), 4 deletions(-)
tests/migration/guestperf/engine.py +5 -1
index 87a6ab2..3d3f6bd 100644
@@ -304,7 +304,6 @@ def _get_common_args(self, hardware, tunnelled=False):
             cmdline = "'" + cmdline + "'"
 
         argv = [
-            "-accel", "kvm",
             "-cpu", "host",
             "-kernel", self._kernel,
             "-initrd", self._initrd,
@@ -315,6 +314,11 @@ def _get_common_args(self, hardware, tunnelled=False):
             "-smp", str(hardware._cpus),
         ]
 
+        if hardware._dirty_ring_size:
+            argv.extend(["-accel", "kvm,dirty-ring-size=%s" % hardware._dirty_ring_size])
+        else:
+            argv.extend(["-accel", "kvm"])
+
         if self._debug:
             argv.extend(["-device", "sga"])
 
tests/migration/guestperf/hardware.py +6 -2
index 3145785..f779cc0 100644
@@ -23,7 +23,8 @@ def __init__(self, cpus=1, mem=1,
                  src_cpu_bind=None, src_mem_bind=None,
                  dst_cpu_bind=None, dst_mem_bind=None,
                  prealloc_pages = False,
-                 huge_pages=False, locked_pages=False):
+                 huge_pages=False, locked_pages=False,
+                 dirty_ring_size=0):
         self._cpus = cpus
         self._mem = mem # GiB
         self._src_mem_bind = src_mem_bind # List of NUMA nodes
@@ -33,6 +34,7 @@ def __init__(self, cpus=1, mem=1,
         self._prealloc_pages = prealloc_pages
         self._huge_pages = huge_pages
         self._locked_pages = locked_pages
+        self._dirty_ring_size = dirty_ring_size
 
 
     def serialize(self):
@@ -46,6 +48,7 @@ def serialize(self):
             "prealloc_pages": self._prealloc_pages,
             "huge_pages": self._huge_pages,
             "locked_pages": self._locked_pages,
+            "dirty_ring_size": self._dirty_ring_size,
         }
 
     @classmethod
@@ -59,4 +62,5 @@ def deserialize(cls, data):
             data["dst_mem_bind"],
             data["prealloc_pages"],
             data["huge_pages"],
-            data["locked_pages"])
+            data["locked_pages"],
+            data["dirty_ring_size"])
tests/migration/guestperf/shell.py +5 -1
index 8a809e3..ecb2d98 100644
@@ -60,6 +60,7 @@ def __init__(self):
         parser.add_argument("--prealloc-pages", dest="prealloc_pages", default=False)
         parser.add_argument("--huge-pages", dest="huge_pages", default=False)
         parser.add_argument("--locked-pages", dest="locked_pages", default=False)
+        parser.add_argument("--dirty-ring-size", dest="dirty_ring_size", default=0, type=int)
 
         self._parser = parser
 
@@ -89,7 +90,10 @@ def split_map(value):
 
                         locked_pages=args.locked_pages,
                         huge_pages=args.huge_pages,
-                        prealloc_pages=args.prealloc_pages)
+                        prealloc_pages=args.prealloc_pages,
+
+                        dirty_ring_size=args.dirty_ring_size)
+
 
 
 class Shell(BaseShell):
Signature · 1 line
1.8.3.1