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

Wolfgang Bumiller w.bumiller at proxmox.com
Thu Apr 20 14:12:11 CEST 2017


Applied with counts fixed up:
    my $max_cpuid = $allowed_cpus[-1];         # removed +1 here
    my @cpu_ctcount = (0) x ($max_cpuid+1);    # added it here

On Thu, Apr 20, 2017 at 10:50:51AM +0200, Wolfgang Bumiller wrote:
> 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