]> git.proxmox.com Git - pve-common.git/commit
cgroup: cpu quota: fix resetting period length for v1
authorOguz Bektas <o.bektas@proxmox.com>
Thu, 21 Oct 2021 14:36:19 +0000 (16:36 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 22 Oct 2021 09:38:08 +0000 (11:38 +0200)
commitd37a71867233a09803e825f0249a1c7df8be25a0
tree0d214709d9cc88ec8417ce78f5ec1aaba6f6c7eb
parentd94f7005cee0677d186f67b5641cd4a96824477c
cgroup: cpu quota: fix resetting period length for v1

The CFS period µs value for cgroup v1 needs to be >= 1 µs and <= 1 s,
so resetting it to -1 (like we cab do for the quota) cannot work.

So, when the period is passed as undefined it should be set to 100ms,
i.e., the actual default value:

>  - cpu.cfs_quota_us: the total available run-time within a period (in microseconds)
>  - cpu.cfs_period_us: the length of a period (in microseconds)
>  - cpu.stat: exports throttling statistics [explained further below]
>
> The default values are:
>     cpu.cfs_period_us=100ms
>     cpu.cfs_quota=-1
-- https://www.kernel.org/doc/html/v5.14/scheduler/sched-bwc.html

This issue was there since initial addition in its original repo,
pve-container commit 26b645e2.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
 [ Thomas: add more information, adapt commit subject to reduce
   redundancy, link to new RsT based doc page with a fixed version ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/CGroup.pm