diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-05-15 11:58:53 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-05-15 12:40:02 +0200 |
commit | 31b8aa3c83f2bb1cd448c40677a1eb8266dad2ce (patch) | |
tree | 993f63699613fb80683d1a4019fd83d0cddeb282 /bbot/agent/machine.cxx | |
parent | 72d8458270a88cde27262afeb54a5345035cfd92 (diff) |
Add CPU boosting for higher 4th priority levels
Diffstat (limited to 'bbot/agent/machine.cxx')
-rw-r--r-- | bbot/agent/machine.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/bbot/agent/machine.cxx b/bbot/agent/machine.cxx index 8308989..16f0525 100644 --- a/bbot/agent/machine.cxx +++ b/bbot/agent/machine.cxx @@ -172,7 +172,8 @@ namespace bbot const optional<string>& mac, const string& br_iface, uint16_t tftp_port, - bool pub_vnc); + bool pub_vnc, + optional<size_t> boost_cpus = nullopt); virtual bool shutdown (size_t& seconds) override; @@ -216,7 +217,8 @@ namespace bbot const optional<string>& omac, const string& br, uint16_t port, - bool pub_vnc) + bool pub_vnc, + optional<size_t> bcpus) : machine (mm.mac ? *mm.mac : // Fixed mac from machine manifest. omac ? *omac : // Generated mac from previous bootstrap. generate_mac ()), @@ -249,7 +251,7 @@ namespace bbot // 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 (ops.cpu ()), cores (cpus); + 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); @@ -672,13 +674,14 @@ namespace bbot const optional<string>& mac, const string& br_iface, uint16_t tftp_port, - bool pub_vnc) + bool pub_vnc, + optional<size_t> bcpus) { switch (mm.type) { case machine_type::kvm: return make_unique<kvm_machine> ( - md, mm, mac, br_iface, tftp_port, pub_vnc); + md, mm, mac, br_iface, tftp_port, pub_vnc, bcpus); case machine_type::nspawn: assert (false); //@@ TODO |