From: Wolfgang Bumiller Date: Thu, 20 Apr 2017 08:47:41 +0000 (+0200) Subject: statd: rebalance: don't use CpuSet::max_cpuids X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=127470f417661746bbce4c4da600d2e9ded33249;p=pve-manager.git statd: rebalance: don't use CpuSet::max_cpuids 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. --- diff --git a/PVE/Service/pvestatd.pm b/PVE/Service/pvestatd.pm index 361c518e..bc62b90b 100755 --- a/PVE/Service/pvestatd.pm +++ b/PVE/Service/pvestatd.pm @@ -235,9 +235,9 @@ 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]; - my @cpu_ctcount = (0) x $max_cpuid; + my @cpu_ctcount = (0) x ($max_cpuid+1); my @balanced_cts; my $modify_cpuset = sub {