[PATCH v2 10/10] tests/vm: add 512MB extra memory per core

John Snow posted 10 patches 3 years, 7 months ago
Maintainers: Michael Roth <michael.roth@amd.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Thomas Huth <thuth@redhat.com>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Beraldo Leal <bleal@redhat.com>
There is a newer version of this series
[PATCH v2 10/10] tests/vm: add 512MB extra memory per core
Posted by John Snow 3 years, 7 months ago
If you try to run a 16 or 32 threaded test, you're going to run out of
memory very quickly with qom-test and a few others. Bump the memory
limit to try to scale with larger-core machines.

Add this magic in early to the configuration process so that the
config file, if provided, can still override it.

Signed-off-by: John Snow <jsnow@redhat.com>
---
 tests/vm/basevm.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index d7d0413df35..69200ca5f1e 100644
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -99,6 +99,12 @@ def __init__(self, args, config=None):
         self._source_path = args.source_path
         # Allow input config to override defaults.
         self._config = DEFAULT_CONFIG.copy()
+
+        if args.jobs and args.jobs > 4:
+            # Add a gig per every 2 jobs over 4
+            overage = (args.jobs - 4) // 2
+            self._config['memory'] = f"{4 + overage}G"
+
         if config != None:
             self._config.update(config)
         self.validate_ssh_keys()
-- 
2.34.3