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 9537E91806 for ; Fri, 7 Oct 2022 14:42:40 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D74D525EB5 for ; Fri, 7 Oct 2022 14:42:09 +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 for ; Fri, 7 Oct 2022 14:42:06 +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 579B64482F for ; Fri, 7 Oct 2022 14:42:05 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Fri, 7 Oct 2022 14:41:51 +0200 Message-Id: <20221007124156.110246-15-f.ebner@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221007124156.110246-1-f.ebner@proxmox.com> References: <20221007124156.110246-1-f.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.027 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [cgroup.pm] Subject: [pve-devel] [RFC common 1/1] change cpu shares: drop unused $cgroupv1_default parameter 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: Fri, 07 Oct 2022 12:42:40 -0000 The only expression it appears in short-circuits, because the line before ensures that $shares is guaranteed to be set. Signed-off-by: Fiona Ebner --- Before we can add a new parameter to the function again, it would need a Breaks for qemu-server and pve-container. So maybe we prefer to just leave it as is? cgroupv1 won't be around forever anyways. 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 45c0788..ae929f0 100644 --- a/src/PVE/CGroup.pm +++ b/src/PVE/CGroup.pm @@ -500,7 +500,7 @@ sub change_cpu_quota { # # Dies on error (including a not-running or currently-shutting-down guest). sub change_cpu_shares { - my ($self, $shares, $cgroupv1_default) = @_; + my ($self, $shares) = @_; my ($path, $ver) = $self->get_path('cpu', 1); if (!defined($path)) { @@ -512,7 +512,7 @@ sub change_cpu_shares { PVE::ProcFSTools::write_proc_entry("$path/cpu.weight", $shares); } elsif ($ver == 1) { $shares //= 1024; - PVE::ProcFSTools::write_proc_entry("$path/cpu.shares", $shares // $cgroupv1_default); + PVE::ProcFSTools::write_proc_entry("$path/cpu.shares", $shares); } else { die "bad cgroup version: $ver\n"; } -- 2.30.2