From d4b1a66860fd841ce4c0824ec2f40abe7eda80fe Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Mon, 29 Jul 2019 16:08:43 +0200 Subject: [PATCH] F #3503: Fix calculation of FREE_CPUs after updating ISOLCPUS --- src/host/HostShare.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/host/HostShare.cc b/src/host/HostShare.cc index dcb6f31d88..abbb95b892 100644 --- a/src/host/HostShare.cc +++ b/src/host/HostShare.cc @@ -617,6 +617,7 @@ void HostShareNode::reserve_cpus(const std::string& cpu_ids) struct Core &c = jt->second; unsigned int fcpus = 0; + unsigned int ucpus = 0; for (auto kt = c.cpus.begin(); kt != c.cpus.end(); ++kt) { @@ -624,9 +625,13 @@ void HostShareNode::reserve_cpus(const std::string& cpu_ids) { fcpus++; } + else if ( kt->second >= 0 ) + { + ucpus++; + } } - if ( c.free_cpus == 0 && fcpus != 0) //CORE policy + if ( c.free_cpus == 0 && ucpus == 1) //CORE policy { continue; }