public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH common] cgroup: fix default values for change_cpu_quota (cgroup v1)
@ 2021-10-21 14:36 Oguz Bektas
  2021-10-22  9:42 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Oguz Bektas @ 2021-10-21 14:36 UTC (permalink / raw)
  To: pve-devel

when period is undefined it should be set to 100ms (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
=====
see [0]

[0]: https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
---
 src/PVE/CGroup.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/PVE/CGroup.pm b/src/PVE/CGroup.pm
index 21681b8..17d2a75 100644
--- a/src/PVE/CGroup.pm
+++ b/src/PVE/CGroup.pm
@@ -467,8 +467,8 @@ sub change_cpu_quota {
 	    PVE::ProcFSTools::write_proc_entry("$path/cpu.max", 'max');
 	}
     } elsif ($ver == 1) {
-	$quota //= -1; # unlimited
-	$period //= -1;
+	$quota //= -1; # default unlimited
+	$period //= 100000; # default 100ms = 100000us
 	PVE::ProcFSTools::write_proc_entry("$path/cpu.cfs_period_us", $period);
 	PVE::ProcFSTools::write_proc_entry("$path/cpu.cfs_quota_us", $quota);
     } else {
-- 
2.30.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: Re: [PATCH common] cgroup: fix default values for change_cpu_quota (cgroup v1)
  2021-10-21 14:36 [pve-devel] [PATCH common] cgroup: fix default values for change_cpu_quota (cgroup v1) Oguz Bektas
@ 2021-10-22  9:42 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2021-10-22  9:42 UTC (permalink / raw)
  To: Proxmox VE development discussion, Oguz Bektas

On 21/10/2021 16:36, Oguz Bektas wrote:
> when period is undefined it should be set to 100ms (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
> =====
> see [0]
> 
> [0]: https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt
> 
> Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
> ---
>  src/PVE/CGroup.pm | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
>

applied, thanks! FYI: I amended the commit message a bit, the subject implied
that more than one value was wrong, so I used:

"cgroup: cpu quota: fix resetting period length for v1"

and linked to the non-legacy, now reStructuredText based version of the
docs to a fixed kernel version (I used v5.14 as some docs rendering issues
got fixed in that version and content wise it did not change).




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-22  9:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21 14:36 [pve-devel] [PATCH common] cgroup: fix default values for change_cpu_quota (cgroup v1) Oguz Bektas
2021-10-22  9:42 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal