tests/vm: allow us to take advantage of MTTCG

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 <[email protected]>
Reviewed-by: Robert Foley <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>

Message-Id: <[email protected]>
This commit is contained in:
Alex Bennée committed 2020-07-11 15:53:00 +01:00
1 parent 2fea3a125d
commit b09539444a
1 file changed
+9 -2
+9 -2
View File
@@ -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