[pve-devel] [PATCH manager] statd: rebalance: don't use CpuSet::max_cpuids

Wolfgang Bumiller w.bumiller at proxmox.com
Thu Apr 20 10:50:51 CEST 2017


We're already limiting CPUs to lxc/cpuset.effective_cpus,
so let's use the highest cpuid from that set as a maximum to
initialize the container count array.
---
 PVE/Service/pvestatd.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/Service/pvestatd.pm b/PVE/Service/pvestatd.pm
index 361c518e..4b8e33d5 100755
--- a/PVE/Service/pvestatd.pm
+++ b/PVE/Service/pvestatd.pm
@@ -235,7 +235,7 @@ sub rebalance_lxc_containers {
     my $all_cpus = PVE::CpuSet->new_from_cgroup('lxc', 'effective_cpus');
     my @allowed_cpus = $all_cpus->members();
     my $cpucount = scalar(@allowed_cpus);
-    my $max_cpuid = PVE::CpuSet::max_cpuid();
+    my $max_cpuid = $allowed_cpus[-1]+1;
 
     my @cpu_ctcount = (0) x $max_cpuid;
     my @balanced_cts;
-- 
2.11.0





More information about the pve-devel mailing list