bugfix: cpushares : default value is 1024 for cgroup v1

Currently if we delete cpuunit (undef), the default value is 100
This commit is contained in:
Alexandre Derumier 2020-11-06 09:24:54 +01:00 committed by Thomas Lamprecht
parent 9465abe251
commit 6d7c306596

View File

@ -472,7 +472,7 @@ sub change_cpu_shares {
die "cpu weight (shares) must be in range [1, 10000]\n" if $shares < 1 || $shares > 10000; die "cpu weight (shares) must be in range [1, 10000]\n" if $shares < 1 || $shares > 10000;
PVE::ProcFSTools::write_proc_entry("$path/cpu.weight", $shares); PVE::ProcFSTools::write_proc_entry("$path/cpu.weight", $shares);
} elsif ($ver == 1) { } elsif ($ver == 1) {
$shares //= 100; $shares //= 1024;
PVE::ProcFSTools::write_proc_entry("$path/cpu.shares", $shares // $cgroupv1_default); PVE::ProcFSTools::write_proc_entry("$path/cpu.shares", $shares // $cgroupv1_default);
} else { } else {
die "bad cgroup version: $ver\n"; die "bad cgroup version: $ver\n";