irqbalance/0003-When-IRQBALANCE_BANNED_CPUS-is-set-proc-stat-is-not-.patch

45 lines
1.3 KiB
Diff
Raw Normal View History

From 718561bc79c095909f0c9d3fb2f0c1c163478b1e Mon Sep 17 00:00:00 2001
From: Petr Holasek <pholasek@redhat.com>
Date: Mon, 20 Feb 2012 16:59:05 +0100
Subject: [PATCH 3/8] When IRQBALANCE_BANNED_CPUS is set, /proc/stat is not
parsed properly.
proc stats counts all the cpus in /proc/stat, but compares that number to the
value in get_cpu_count(), which returns the number of cpus actively being
balanced. Since that value doesn't include banned cpus, its incorrect. Since
we don't want to measure the load on banned cpus anyway, just skip those lines
so cpucount doesn't increment and the count remains equal.
Signed-off-by: Petr Holasek <pholasek@redhat.com>
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
---
procinterrupts.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/procinterrupts.c b/procinterrupts.c
index 4d3b07b..c032caf 100644
--- a/procinterrupts.c
+++ b/procinterrupts.c
@@ -32,6 +32,8 @@
#define LINESIZE 4096
+extern cpumask_t banned_cpus;
+
static int proc_int_has_msi = 0;
static int msi_found_in_sysfs = 0;
@@ -217,6 +219,9 @@ void parse_proc_stat(void)
cpunr = strtoul(&line[3], NULL, 10);
+ if (cpu_isset(cpunr, banned_cpus))
+ continue;
+
rc = sscanf(line, "%*s %*d %*d %*d %*d %*d %d %d", &irq_load, &softirq_load);
if (rc < 2)
break;
--
1.7.11.4