Blame SOURCES/0014-Improve-documentation-and-logging-for-banned-cpus.patch

7bf5db
From cfb15f0bb95ebfd4357708eae42febe9f2121fba Mon Sep 17 00:00:00 2001
7bf5db
From: Tao Liu <ltao@redhat.com>
7bf5db
Date: Wed, 13 Jul 2022 17:11:40 +0800
7bf5db
Subject: [PATCH 14/14] Improve documentation and logging for banned cpus
7bf5db
7bf5db
This patch have no functional modification. Just improve the doc and log
7bf5db
for isolcpu, nohz_full and numa node banning cpus, for providing more
7bf5db
info for users.
7bf5db
7bf5db
Signed-off-by: Tao Liu <ltao@redhat.com>
7bf5db
---
7bf5db
 cputree.c    | 6 +++---
7bf5db
 irqbalance.1 | 2 +-
7bf5db
 placement.c  | 6 +++++-
7bf5db
 3 files changed, 9 insertions(+), 5 deletions(-)
7bf5db
7bf5db
diff --git a/cputree.c b/cputree.c
7bf5db
index c250977..eb1981e 100644
7bf5db
--- a/cputree.c
7bf5db
+++ b/cputree.c
7bf5db
@@ -159,14 +159,14 @@ static void setup_banned_cpus(void)
7bf5db
 	cpus_or(banned_cpus, nohz_full, isolated_cpus);
7bf5db
 
7bf5db
 	cpumask_scnprintf(buffer, 4096, isolated_cpus);
7bf5db
-	log(TO_CONSOLE, LOG_INFO, "Isolated CPUs: %s\n", buffer);
7bf5db
+	log(TO_CONSOLE, LOG_INFO, "Prevent irq assignment to these isolated CPUs: %s\n", buffer);
7bf5db
 	cpumask_scnprintf(buffer, 4096, nohz_full);
7bf5db
-	log(TO_CONSOLE, LOG_INFO, "Adaptive-ticks CPUs: %s\n", buffer);
7bf5db
+	log(TO_CONSOLE, LOG_INFO, "Prevent irq assignment to these adaptive-ticks CPUs: %s\n", buffer);
7bf5db
 out:
7bf5db
 #ifdef HAVE_THERMAL
7bf5db
 	cpus_or(banned_cpus, banned_cpus, thermal_banned_cpus);
7bf5db
 	cpumask_scnprintf(buffer, 4096, thermal_banned_cpus);
7bf5db
-	log(TO_CONSOLE, LOG_INFO, "Thermal-banned CPUs: %s\n", buffer);
7bf5db
+	log(TO_CONSOLE, LOG_INFO, "Prevent irq assignment to these thermal-banned CPUs: %s\n", buffer);
7bf5db
 #endif
7bf5db
 	cpumask_scnprintf(buffer, 4096, banned_cpus);
7bf5db
 	log(TO_CONSOLE, LOG_INFO, "Banned CPUs: %s\n", buffer);
7bf5db
diff --git a/irqbalance.1 b/irqbalance.1
7bf5db
index 361faea..4c75362 100644
7bf5db
--- a/irqbalance.1
7bf5db
+++ b/irqbalance.1
7bf5db
@@ -167,7 +167,7 @@ Same as --debug.
7bf5db
 .B IRQBALANCE_BANNED_CPUS
7bf5db
 Provides a mask of CPUs which irqbalance should ignore and never assign interrupts to.
7bf5db
 If not specified, irqbalance use mask of isolated and adaptive-ticks CPUs on the
7bf5db
-system as the default value.
7bf5db
+system as the default value. The "isolcpus=" boot parameter specifies the isolated CPUs. The "nohz_full=" boot parameter specifies the adaptive-ticks CPUs. By default, no CPU will be an isolated or adaptive-ticks CPU.
7bf5db
 This is a hexmask without the leading ’0x’. On systems with large numbers of
7bf5db
 processors, each group of eight hex digits is separated by a comma ’,’. i.e.
7bf5db
 ‘export IRQBALANCE_BANNED_CPUS=fc0‘ would prevent irqbalance from assigning irqs
7bf5db
diff --git a/placement.c b/placement.c
7bf5db
index 17a9f2e..9fde8cb 100644
7bf5db
--- a/placement.c
7bf5db
+++ b/placement.c
7bf5db
@@ -135,8 +135,12 @@ static void place_irq_in_node(struct irq_info *info, void *data __attribute__((u
7bf5db
 		 * Need to make sure this node is elligible for migration
7bf5db
 		 * given the banned cpu list
7bf5db
 		 */
7bf5db
-		if (!cpus_intersects(irq_numa_node(info)->mask, unbanned_cpus))
7bf5db
+		if (!cpus_intersects(irq_numa_node(info)->mask, unbanned_cpus)) {
7bf5db
+			log(TO_CONSOLE, LOG_WARNING, "There is no suitable CPU in node:%d.\n", irq_numa_node(info)->number);
7bf5db
+			log(TO_CONSOLE, LOG_WARNING, "Irqbalance dispatch irq:%d to other node.\n", info->irq);
7bf5db
 			goto find_placement;
7bf5db
+		}
7bf5db
+
7bf5db
 		/*
7bf5db
 		 * This irq belongs to a device with a preferred numa node
7bf5db
 		 * put it on that node
7bf5db
-- 
7bf5db
2.33.1
7bf5db