[pve-devel] [PATCH manager] pvestatd: fix rebalancing cpusets for cgroupv2

Oguz Bektas o.bektas at proxmox.com
Thu Oct 14 08:51:48 CEST 2021


currently we only check the entry for cgroup v1 to decide if cores
should be rebalanced. extend the check to include cgroup v2 entries.

reported in forum [0]

[0]: https://forum.proxmox.com/threads/hard-set-streams-for-lxc-container.97768/

Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
---
 PVE/Service/pvestatd.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/PVE/Service/pvestatd.pm b/PVE/Service/pvestatd.pm
index 7193388c..26d96bb2 100755
--- a/PVE/Service/pvestatd.pm
+++ b/PVE/Service/pvestatd.pm
@@ -343,8 +343,9 @@ sub rebalance_lxc_containers {
 
 	my @cpuset_members = $cpuset->members();
 
-	if (!PVE::LXC::Config->has_lxc_entry($conf, 'lxc.cgroup.cpuset.cpus')) {
-
+	if (!PVE::LXC::Config->has_lxc_entry($conf, 'lxc.cgroup.cpuset.cpus')
+	    && !PVE::LXC::Config->has_lxc_entry($conf, 'lxc.cgroup2.cpuset.cpus')
+	) {
 	    my $cores = $conf->{cores} || $cpucount;
 	    $cores = $cpucount if $cores > $cpucount;
 
-- 
2.30.2





More information about the pve-devel mailing list