diff mbox series

[v2,4/6] tests/migration: Introduce dirty-ring-size option into guestperf

Message ID bd9f195883fb5081f67f680bd2972a4b0a5b3520.1697815117.git.yong.huang@smartx.com (mailing list archive)
State New, archived
Headers show
Series dirtylimit: miscellaneous patches | expand

Commit Message

Yong Huang Oct. 20, 2023, 3:23 p.m. UTC
Dirty ring size configuration is not supported by guestperf tool.

Introduce dirty-ring-size (ranges in [1024, 65536]) option so
developers can play with dirty-ring and dirty-limit feature easier.

To set dirty ring size with 4096 during migration test:
$ ./tests/migration/guestperf.py --dirty-ring-size 4096 xxx

Signed-off-by: Hyman Huang <yong.huang@smartx.com>
---
 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(-)

Comments

Yong Huang Oct. 23, 2023, 2:03 a.m. UTC | #1
ping.

Regarding the performance of the live migration, Guestperf could provide us
with a clear response. IMHO, by just adding a few metrics, it might be
developed
into a more user-friendly metrics system in the future.

We may still enrich it prior to that.

On Fri, Oct 20, 2023 at 11:24 PM Hyman Huang <yong.huang@smartx.com> wrote:

> Dirty ring size configuration is not supported by guestperf tool.
>
> Introduce dirty-ring-size (ranges in [1024, 65536]) option so
> developers can play with dirty-ring and dirty-limit feature easier.
>
> To set dirty ring size with 4096 during migration test:
> $ ./tests/migration/guestperf.py --dirty-ring-size 4096 xxx
>
> Signed-off-by: Hyman Huang <yong.huang@smartx.com>
> ---
>  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(-)
>
> diff --git a/tests/migration/guestperf/engine.py
> b/tests/migration/guestperf/engine.py
> index da96ca034a..aabf6de4d9 100644
> --- a/tests/migration/guestperf/engine.py
> +++ b/tests/migration/guestperf/engine.py
> @@ -325,7 +325,6 @@ def _get_common_args(self, hardware, tunnelled=False):
>              cmdline = "'" + cmdline + "'"
>
>          argv = [
> -            "-accel", "kvm",
>              "-cpu", "host",
>              "-kernel", self._kernel,
>              "-initrd", self._initrd,
> @@ -333,6 +332,11 @@ def _get_common_args(self, hardware, tunnelled=False):
>              "-m", str((hardware._mem * 1024) + 512),
>              "-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"])
>
>          argv.extend(self._get_qemu_serial_args())
>
> diff --git a/tests/migration/guestperf/hardware.py
> b/tests/migration/guestperf/hardware.py
> index 3145785ffd..f779cc050b 100644
> --- a/tests/migration/guestperf/hardware.py
> +++ b/tests/migration/guestperf/hardware.py
> @@ -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"])
> diff --git a/tests/migration/guestperf/shell.py
> b/tests/migration/guestperf/shell.py
> index 8a809e3dda..7d6b8cd7cf 100644
> --- a/tests/migration/guestperf/shell.py
> +++ b/tests/migration/guestperf/shell.py
> @@ -60,6 +60,8 @@ 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 +91,9 @@ 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):
> --
> 2.39.1
>
>
Yong Huang Oct. 27, 2023, 3 p.m. UTC | #2
ping1

在 2023/10/23 10:03, Yong Huang 写道:
> ping.
>
> Regarding the performance of the live migration, Guestperf could 
> provide us
> with a clear response. IMHO, by just adding a few metrics, it might be 
> developed
> into a more user-friendly metrics system in the future.
>
> We may still enrich it prior to that.
>
> On Fri, Oct 20, 2023 at 11:24 PM Hyman Huang <yong.huang@smartx.com> 
> wrote:
>
>     Dirty ring size configuration is not supported by guestperf tool.
>
>     Introduce dirty-ring-size (ranges in [1024, 65536]) option so
>     developers can play with dirty-ring and dirty-limit feature easier.
>
>     To set dirty ring size with 4096 during migration test:
>     $ ./tests/migration/guestperf.py --dirty-ring-size 4096 xxx
>
>     Signed-off-by: Hyman Huang <yong.huang@smartx.com>
>     ---
>      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(-)
>
>     diff --git a/tests/migration/guestperf/engine.py
>     b/tests/migration/guestperf/engine.py
>     index da96ca034a..aabf6de4d9 100644
>     --- a/tests/migration/guestperf/engine.py
>     +++ b/tests/migration/guestperf/engine.py
>     @@ -325,7 +325,6 @@ def _get_common_args(self, hardware,
>     tunnelled=False):
>                  cmdline = "'" + cmdline + "'"
>
>              argv = [
>     -            "-accel", "kvm",
>                  "-cpu", "host",
>                  "-kernel", self._kernel,
>                  "-initrd", self._initrd,
>     @@ -333,6 +332,11 @@ def _get_common_args(self, hardware,
>     tunnelled=False):
>                  "-m", str((hardware._mem * 1024) + 512),
>                  "-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"])
>
>              argv.extend(self._get_qemu_serial_args())
>
>     diff --git a/tests/migration/guestperf/hardware.py
>     b/tests/migration/guestperf/hardware.py
>     index 3145785ffd..f779cc050b 100644
>     --- a/tests/migration/guestperf/hardware.py
>     +++ b/tests/migration/guestperf/hardware.py
>     @@ -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"])
>     diff --git a/tests/migration/guestperf/shell.py
>     b/tests/migration/guestperf/shell.py
>     index 8a809e3dda..7d6b8cd7cf 100644
>     --- a/tests/migration/guestperf/shell.py
>     +++ b/tests/migration/guestperf/shell.py
>     @@ -60,6 +60,8 @@ 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 +91,9 @@ 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):
>     -- 
>     2.39.1
>
>
>
> -- 
> Best regards
Fabiano Rosas Oct. 27, 2023, 3:48 p.m. UTC | #3
Hyman Huang <yong.huang@smartx.com> writes:

> Dirty ring size configuration is not supported by guestperf tool.
>
> Introduce dirty-ring-size (ranges in [1024, 65536]) option so
> developers can play with dirty-ring and dirty-limit feature easier.
>
> To set dirty ring size with 4096 during migration test:
> $ ./tests/migration/guestperf.py --dirty-ring-size 4096 xxx
>
> Signed-off-by: Hyman Huang <yong.huang@smartx.com>

Reviewed-by: Fabiano Rosas <farosas@suse.de>
diff mbox series

Patch

diff --git a/tests/migration/guestperf/engine.py b/tests/migration/guestperf/engine.py
index da96ca034a..aabf6de4d9 100644
--- a/tests/migration/guestperf/engine.py
+++ b/tests/migration/guestperf/engine.py
@@ -325,7 +325,6 @@  def _get_common_args(self, hardware, tunnelled=False):
             cmdline = "'" + cmdline + "'"
 
         argv = [
-            "-accel", "kvm",
             "-cpu", "host",
             "-kernel", self._kernel,
             "-initrd", self._initrd,
@@ -333,6 +332,11 @@  def _get_common_args(self, hardware, tunnelled=False):
             "-m", str((hardware._mem * 1024) + 512),
             "-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"])
 
         argv.extend(self._get_qemu_serial_args())
 
diff --git a/tests/migration/guestperf/hardware.py b/tests/migration/guestperf/hardware.py
index 3145785ffd..f779cc050b 100644
--- a/tests/migration/guestperf/hardware.py
+++ b/tests/migration/guestperf/hardware.py
@@ -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"])
diff --git a/tests/migration/guestperf/shell.py b/tests/migration/guestperf/shell.py
index 8a809e3dda..7d6b8cd7cf 100644
--- a/tests/migration/guestperf/shell.py
+++ b/tests/migration/guestperf/shell.py
@@ -60,6 +60,8 @@  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 +91,9 @@  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):