From 12460744f602d95b074301a8bce652f16ade013c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 21 Jun 2023 06:57:52 +0200 Subject: Adjust sockets/cores/threads splits to better reflect modern hardware --- bbot/agent/machine.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'bbot') diff --git a/bbot/agent/machine.cxx b/bbot/agent/machine.cxx index 16f0525..84916f6 100644 --- a/bbot/agent/machine.cxx +++ b/bbot/agent/machine.cxx @@ -244,20 +244,21 @@ namespace bbot // log = path ("/tmp/" + path::traits_type::temp_name (name) + ".log"); - // Map logical CPUs to sockets/cores/threads keeping the number of and - // cores even. Failed that, QEMU just makes it a machine with that number - // of sockets and some operating systems (like Windows) can only do two. + // Map logical CPUs to sockets/cores/threads keeping the number of sockets + // and cores even. Failed that, QEMU just makes it a machine with that + // number of sockets and some operating systems (like Windows) can only do + // two. // // Note that for best results you may want to adjust (e.g., by over- // committing) the number of CPUs to be power of 2. // size_t cpus (bcpus ? *bcpus : ops.cpu ()), cores (cpus); - size_t sockets (cores >= 16 && cores % 4 == 0 ? 2 : - cores >= 64 && cores % 8 == 0 ? 4 : 1); + size_t sockets (cores >= 256 && cores % 8 == 0 ? 4 : + cores >= 128 && cores % 4 == 0 ? 2 : 1); cores /= sockets; - size_t threads (cores >= 8 && cores % 4 == 0 ? 2 : 1); + size_t threads (cores >= 16 && cores % 4 == 0 ? 2 : 1); cores /= threads; // We probably don't want to commit all the available RAM to the VM since -- cgit v1.1