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 5422B78F8B for ; Fri, 1 Jul 2022 02:10:40 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 47D2C3A58 for ; Fri, 1 Jul 2022 02:10:10 +0200 (CEST) Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 1 Jul 2022 02:10:05 +0200 (CEST) Received: by mail-pl1-x62b.google.com with SMTP id jh14so832692plb.1 for ; Thu, 30 Jun 2022 17:10:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bowdernet.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AK1F+qg+nw8prUZtJ9MAHzLs0cGSO1+G6IR9LcrJSr0=; b=lGzHKUiqS6sRFCutk7DvxDqsTV0y6oeauCo+yJJwX5hrTq+nqX8cNMNwbe9BHG2NZh 86vJ9dFWfNBnPMdlsy1+GNIbGpmR00I4KFMB/pqlpagJgccW7YmN7JrTaCTEiblEBiKv ktHpIom+TkrpUL6omVUzAQ/FNOpZ4/9cQRuc+4B8SV9m2q8dmnkGJG7ETiCPqX8aU6S5 oHYxoCHuvdHY7Jd/nzsv7WBoPe56L5tTpdcR4KYdP+BbqjHRU5F6UqyPReTSQx5TTMLS 5nnCobodZXLMcuQQ5XH2fFRVQLvu6Jp3kznqejwH73B4mhIaJsTXcV2C8enkV7oCPN6D eEVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AK1F+qg+nw8prUZtJ9MAHzLs0cGSO1+G6IR9LcrJSr0=; b=G5bdD3BMfmvx7r8X2zhJ35J/sXhUQ+pJeZik0FsttgdIedEDghHDsTbTNOubYZnogI kGln3bFdAbWFpuwQhMJCK2w/sK1szIBkO+DXds1UECKxmpl9UkevYVbCveqRrNKFurs3 p1gVNEOd/ud8yP+ZdE2ii53imUBiFZAtteamMg63EYavGpBlDovVsLY44foPT8zux0NG P6u7l83wMWTzl6QbyAsR5dshAc3E48l0oIV5VM83gZdUcjOLDjqnVOMLq5EL13kz5efe o+C+05ntg9f7lbZhmu8zXFiUlgYrEYxWGFXuiKqJu9P8VMu8QvYSl3HBSvxncZ6EWjHr AdHA== X-Gm-Message-State: AJIora/l95DNtp4BQaNWiX/SjAUWJVDzREGgf9e0vHgxG1RgWhHdiHH/ lzuTGeVFiU5HO60yno9vZBz6GVDQP6fEb60e X-Google-Smtp-Source: AGRyM1uf+7+j1LuWN3wsbp34cIKDzeLU8jbQxpucLDHCMFrMaxAllQuX6AtzAzGch9vYnrON0jDbrA== X-Received: by 2002:a17:903:2447:b0:16a:3b58:48dd with SMTP id l7-20020a170903244700b0016a3b5848ddmr18571432pls.120.1656634195809; Thu, 30 Jun 2022 17:09:55 -0700 (PDT) Received: from localhost.localdomain (c-24-19-168-226.hsd1.wa.comcast.net. [24.19.168.226]) by smtp.gmail.com with ESMTPSA id g6-20020a631106000000b004114aad90ebsm7296066pgl.49.2022.06.30.17.09.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jun 2022 17:09:55 -0700 (PDT) From: Daniel Bowder To: pve-devel@lists.proxmox.com Cc: Daniel Bowder Date: Thu, 30 Jun 2022 17:09:46 -0700 Message-Id: <20220701000948.148496-3-daniel@bowdernet.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220701000948.148496-1-daniel@bowdernet.com> References: <20220701000948.148496-1-daniel@bowdernet.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.025 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [PATCH v2 pve-docs 2/4] fix #3593: add affinity to docs 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, 01 Jul 2022 00:10:40 -0000 Added affinity to the resource limiting info in qm.adoc. Added affinity to the qemu conf spec in qm.conf.5-opts.adoc. Signed-off-by: Daniel Bowder --- qm.adoc | 15 +++++++++++++++ qm.conf.5-opts.adoc | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/qm.adoc b/qm.adoc index 4d0c7c4..3722726 100644 --- a/qm.adoc +++ b/qm.adoc @@ -328,6 +328,21 @@ For more information see `man systemd.resource-control`, here `CPUQuota` corresponds to `cpulimit` and `CPUShares` corresponds to our `cpuunits` setting, visit its Notes section for references and implementation details. +The third CPU resource limiting setting, *affinity*, controls what host cores +the virtual machine will be permitted to execute on. E.g., if an affinity value +of `0-3,8-11` is provided, the virtual machine will be restricted to using the +host cores `0,1,2,3,8,9,10,` and `11`. Valid *affinity* values are written in +cpuset `List Format`. List Format is a comma-separated list of CPU numbers and +ranges of numbers, in ASCII decimal. + +NOTE: CPU *affinity* uses the `taskset` command to restrict virtual machines to +a given set of cores. This restriction will not take effect for some types of +processes that may be created for IO. *CPU affinity is not a security feature.* + +For more information regarding *affinity* see `man cpuset`. Here the +`List Format` corresponds to valid *affinity* values. Visit its `Formats` +section for more examples. + CPU Type ^^^^^^^^ diff --git a/qm.conf.5-opts.adoc b/qm.conf.5-opts.adoc index a56dc5d..e46b4c2 100644 --- a/qm.conf.5-opts.adoc +++ b/qm.conf.5-opts.adoc @@ -155,6 +155,10 @@ Limit of CPU usage. + NOTE: If the computer has 2 CPUs, it has total of '2' CPU time. Value '0' indicates no CPU limit. +`affinity`: ``:: + +Set of CPU cores to pin the virtual machine processes to. This is a comma sepparated list of numbers or ranges in list format as defined by the Linux man page for cpuset. ( e.g `0,4-6,9` ) + `cpuunits`: ` (1 - 262144)` ('default =' `cgroup v1: 1024, cgroup v2: 100`):: CPU weight for a VM. Argument is used in the kernel fair scheduler. The larger the number is, the more CPU time this VM gets. Number is relative to weights of all the other running VMs. -- 2.36.1