]> git.proxmox.com Git - pve-manager.git/commitdiff
statd: rebalance: don't use CpuSet::max_cpuids
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 20 Apr 2017 08:47:41 +0000 (10:47 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 20 Apr 2017 10:18:55 +0000 (12:18 +0200)
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

index 361c518e6317e3b5d0d36d25f65542755cbf6c60..bc62b90b70c2bb74560b6756a272e9d116fadcdc 100755 (executable)
@@ -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 {