From b09539444a4b319b02043638682867ad02b1f47e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Wed, 1 Jul 2020 14:56:27 +0100 Subject: [PATCH] tests/vm: allow us to take advantage of MTTCG MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We currently limit TCG guests to -smp 1 but now we have added some aarch64 guests we can do better when running on x86_64 hardware. Raise the limit for TCG guests when it is safe to do so. Signed-off-by: Alex Bennée Reviewed-by: Robert Foley Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200701135652.1366-16-alex.bennee@linaro.org> --- tests/vm/basevm.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index cc0809b6c7..7acb48b876 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -551,8 +551,15 @@ def parse_config(config, args): def parse_args(vmcls): def get_default_jobs(): - if kvm_available(vmcls.arch): - return multiprocessing.cpu_count() // 2 + if multiprocessing.cpu_count() > 1: + if kvm_available(vmcls.arch): + return multiprocessing.cpu_count() // 2 + elif os.uname().machine == "x86_64" and \ + vmcls.arch in ["aarch64", "x86_64", "i386"]: + # MTTCG is available on these arches and we can allow + # more cores. but only up to a reasonable limit. User + # can always override these limits with --jobs. + return min(multiprocessing.cpu_count() // 2, 8) else: return 1