[irqbalance/f16] Resolves: bz790899

Petr Holasek pholasek at fedoraproject.org
Thu Mar 1 12:07:03 UTC 2012


commit a33f1c0ac3ccc4bfdd6053f304e537206e6f27ca
Author: Petr Holasek <pholasek at redhat.com>
Date:   Thu Mar 1 12:22:10 2012 +0100

    Resolves: bz790899

 irqbalance-bz790899-banned-cpus.patch |   38 +++++++++++++++++++++++++++++++++
 irqbalance.spec                       |    7 +++++-
 2 files changed, 44 insertions(+), 1 deletions(-)
---
diff --git a/irqbalance-bz790899-banned-cpus.patch b/irqbalance-bz790899-banned-cpus.patch
new file mode 100644
index 0000000..586fd45
--- /dev/null
+++ b/irqbalance-bz790899-banned-cpus.patch
@@ -0,0 +1,38 @@
+commit e9e9dda3037dac1792f127f93ae743ffb92be910
+Author: Petr Holasek <pholasek at redhat.com>
+Date:   Mon Feb 20 16:59:05 2012 +0100
+
+    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 at redhat.com>
+    Signed-off-by: Neil Horman <nhorman at tuxdriver.com>
+
+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;	
diff --git a/irqbalance.spec b/irqbalance.spec
index dc38fe7..80e843d 100644
--- a/irqbalance.spec
+++ b/irqbalance.spec
@@ -1,6 +1,6 @@
 Name:           irqbalance
 Version:        1.0.3
-Release:        2%{?dist}
+Release:        3%{?dist}
 Epoch:          2
 Summary:        IRQ balancing daemon
 
@@ -21,6 +21,7 @@ Requires(preun):systemd-units
 ExclusiveArch: %{ix86} x86_64 ia64 ppc ppc64
 
 Patch0: irqbalance-bz781578-powerthresh-hysteresis.patch
+Patch1: irqbalance-bz790899-banned-cpus.patch
 
 %description
 irqbalance is a daemon that evenly distributes IRQ load across
@@ -29,6 +30,7 @@ multiple CPUs for enhanced performance.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 %{configure}
@@ -77,6 +79,9 @@ fi
 /sbin/chkconfig --del irqbalance >/dev/null 2>&1 || :
 
 %changelog
+* Thu Mar 1 2012 Petr Holasek <pholasek at redhat.com> - 2:1.0.3-3
+- Fixed stat file parsing when some cpus are banned (bz 790899)
+
 * Mon Jan 16 2012 Neil Horman <nhorman at redhat.com> - 2:1.0.3-2
 - Fixed log spew on powerthresh re-enablement (bz 781578)
 


More information about the scm-commits mailing list