From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id A54FA773F4 for ; Thu, 21 Oct 2021 16:36:57 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 91F552093C for ; Thu, 21 Oct 2021 16:36:27 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 0DD9320931 for ; Thu, 21 Oct 2021 16:36:26 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id CE52C4691D for ; Thu, 21 Oct 2021 16:36:25 +0200 (CEST) From: Oguz Bektas To: pve-devel@lists.proxmox.com Date: Thu, 21 Oct 2021 16:36:19 +0200 Message-Id: <20211021143619.1591105-1-o.bektas@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.895 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH common] cgroup: fix default values for change_cpu_quota (cgroup v1) X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Oct 2021 14:36:57 -0000 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 --- 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