[pve-devel] [PATCH] Update cpu.weight default to match documented default

Fiona Ebner f.ebner at proxmox.com
Fri Aug 19 12:08:00 CEST 2022


Hi,

On 16.08.22 05:49, Matt Corallo wrote:
> Proxmox documentation describes the default CPU weight as 1024 in
> numerous places. However, when unset, the Linux default CGROUP
> weight is 100.
> 

I'd rather update the documentation in all places, because most likely
it just wasn't adapted to mention the cgroup2 default yet. Some places
already do mention both defaults, e.g. 'man 5 qm.conf'

> This simply always writes an `lxc.cgroup2.cpu.weight` option to the
> LXC config file, defaulting to 1024 instead of omitting the option
> entirely.
> 
> Signed-off-by: Matt Corallo <git at bluematt.me>
> ---
>  src/PVE/LXC.pm | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
> index fe63087..ca453a9 100644
> --- a/src/PVE/LXC.pm
> +++ b/src/PVE/LXC.pm
> @@ -712,6 +712,9 @@ sub update_lxc_config {
>          die "cpu weight (shares) must be in range [1, 10000]\n"
>          if $shares < 1 || $shares > 10000;
>          $raw .= "lxc.cgroup2.cpu.weight = $shares\n";
> +    } else {
> +        # Default as documented
> +        $raw .= "lxc.cgroup2.cpu.weight = 1024\n";
>      }
>      }
> 





More information about the pve-devel mailing list