diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-06-21 06:57:52 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-06-21 06:57:52 +0200 |
commit | 12460744f602d95b074301a8bce652f16ade013c (patch) | |
tree | 11a2d21489e91e0f0c74871c4a3efc69d2a56219 | |
parent | 9167a07319cd8b35d27d740af63d593fb6c37d0b (diff) |
Adjust sockets/cores/threads splits to better reflect modern hardware
-rw-r--r-- | bbot/agent/machine.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
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 |