From 635fc48ac78acef895a2d8d4e2966efa5b5e31cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20Dupr=C3=A9?= Date: Thu, 8 Feb 2024 16:31:41 +0100 Subject: [PATCH] irqbalance: fix set_irq_max_core.sh script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The set_irq_max_core.sh script is used to set the maximum core for irqbalance to use. The script uses the nproc command to determine the number of cores on the system. However, the nproc without any options only returns the number of cores available to the current process. This means that the script will not work correctly if the number of cores available to the current process is less than the total number of cores on the system for instance if isolcpus is used. This patch changes the nproc command to use the --all option to return the total number of cores on the system. Signed-off-by: Mathieu Dupré --- recipes-extended/irqbalance/files/set_irq_max_core.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-extended/irqbalance/files/set_irq_max_core.sh b/recipes-extended/irqbalance/files/set_irq_max_core.sh index 3d59d0ac..a0a34112 100755 --- a/recipes-extended/irqbalance/files/set_irq_max_core.sh +++ b/recipes-extended/irqbalance/files/set_irq_max_core.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -MAX_CPU_CORE=$(($(nproc) - 1)) +MAX_CPU_CORE=$(($(nproc --all) - 1)) CPU_BAN_LIST=$(grep 'IRQBALANCE_BANNED_CPULIST' /etc/irqbalance.env | awk -F= '{print $2}') if echo "$CPU_BAN_LIST" | grep -q 'N'; then