From 28b13b7e8e6e1e4fa1593f0dfb1c37569f2f90a8 Mon Sep 17 00:00:00 2001 From: Parabola Date: Tue, 15 Nov 2011 14:34:01 +0000 Subject: Tue Nov 15 14:33:58 UTC 2011 --- .../Fix-detection-of-CPUs-in-sysfs.patch | 35 ---- ...errupt-counts-line-NMI-may-start-with-a-s.patch | 67 ------- extra/irqbalance/current-trunk.patch | 217 --------------------- 3 files changed, 319 deletions(-) delete mode 100644 extra/irqbalance/Fix-detection-of-CPUs-in-sysfs.patch delete mode 100644 extra/irqbalance/Special-interrupt-counts-line-NMI-may-start-with-a-s.patch delete mode 100644 extra/irqbalance/current-trunk.patch (limited to 'extra/irqbalance') diff --git a/extra/irqbalance/Fix-detection-of-CPUs-in-sysfs.patch b/extra/irqbalance/Fix-detection-of-CPUs-in-sysfs.patch deleted file mode 100644 index 56bd529c2..000000000 --- a/extra/irqbalance/Fix-detection-of-CPUs-in-sysfs.patch +++ /dev/null @@ -1,35 +0,0 @@ -From: Shawn Bohrer - -Only count directories that match /sys/devices/system/cpu/cpu[0-9]+ as -CPUs. Previously any directory that started with cpu was counted which -caused cpufreq and cpuidle to be counted as CPUs. - -Signed-off-by: Shawn Bohrer ---- - cputree.c | 3 ++- - 1 files changed, 2 insertions(+), 1 deletions(-) - -diff --git a/cputree.c b/cputree.c -index 3b0c982..b879785 100644 ---- a/cputree.c -+++ b/cputree.c -@@ -25,6 +25,7 @@ - */ - - #include "config.h" -+#include - #include - #include - #include -@@ -321,7 +322,7 @@ void parse_cpu_tree(void) - return; - do { - entry = readdir(dir); -- if (entry && strlen(entry->d_name)>3 && strstr(entry->d_name,"cpu")) { -+ if (entry && !strncmp(entry->d_name,"cpu", 3) && isdigit(entry->d_name[3])) { - char new_path[PATH_MAX]; - sprintf(new_path, "/sys/devices/system/cpu/%s", entry->d_name); - do_one_cpu(new_path); --- -1.6.5.2 - diff --git a/extra/irqbalance/Special-interrupt-counts-line-NMI-may-start-with-a-s.patch b/extra/irqbalance/Special-interrupt-counts-line-NMI-may-start-with-a-s.patch deleted file mode 100644 index c2e69c218..000000000 --- a/extra/irqbalance/Special-interrupt-counts-line-NMI-may-start-with-a-s.patch +++ /dev/null @@ -1,67 +0,0 @@ -From: Shawn Bohrer - -Special interrupt counts line NMI may start with a space - -The kernel determines the maximum number of possible IRQs and pads the -first field of /proc/interrupts appropriately. With four or more digits -of precession the special interrupt counts all start with a space -instead of a letter. This caused the special interrupt counts to be -counted on my system and that caused the cpunr count to be off when it -reached the ERR and MIS lines forcing a CPU rescan. - -Signed-off-by: Shawn Bohrer ---- - procinterrupts.c | 24 +++++++++++------------- - 1 files changed, 11 insertions(+), 13 deletions(-) - -diff --git a/procinterrupts.c b/procinterrupts.c -index e336efe..322f4de 100644 ---- a/procinterrupts.c -+++ b/procinterrupts.c -@@ -55,20 +55,18 @@ void parse_proc_interrupts(void) - if (getline(&line, &size, file)==0) - break; - -- -+ number = strtoul(line, &c, 10); - /* lines with letters in front are special, like NMI count. Ignore */ -- if (!(line[0]==' ' || (line[0]>='0' && line[0]<='9'))) -- break; -- c = strchr(line, ':'); -- if (!c) -+ if (line == c) -+ continue; -+ -+ if (c[0] == ':') -+ ++c; -+ else - continue; -- *c = 0; -- c++; -- number = strtoul(line, NULL, 10); -+ - count = 0; - cpunr = 0; -- -- c2=NULL; - while (1) { - uint64_t C; - C = strtoull(c, &c2, 10); -@@ -78,11 +76,11 @@ void parse_proc_interrupts(void) - c=c2; - cpunr++; - } -- if (cpunr != core_count) -+ if (cpunr != core_count) - need_cpu_rescan = 1; -- -+ - set_interrupt_count(number, count); -- } -+ } - fclose(file); - free(line); - } --- -1.6.5.2 - diff --git a/extra/irqbalance/current-trunk.patch b/extra/irqbalance/current-trunk.patch deleted file mode 100644 index 83f08575c..000000000 --- a/extra/irqbalance/current-trunk.patch +++ /dev/null @@ -1,217 +0,0 @@ -Index: powermode.c -=================================================================== ---- powermode.c (.../tags/irqbalance-0.56) (revision 33) -+++ powermode.c (.../trunk) (revision 33) -@@ -40,7 +40,8 @@ - char *line = NULL; - size_t size = 0; - char *c; -- uint64_t dummy, irq, softirq; -+ uint64_t dummy __attribute__((unused)); -+ uint64_t irq, softirq; - file = fopen("/proc/stat", "r"); - if (!file) - return; -Index: cputree.c -=================================================================== ---- cputree.c (.../tags/irqbalance-0.56) (revision 33) -+++ cputree.c (.../trunk) (revision 33) -@@ -47,6 +47,7 @@ - /* Users want to be able to keep interrupts away from some cpus; store these in a cpumask_t */ - cpumask_t banned_cpus; - -+cpumask_t cpu_possible_map; - - /* - it's convenient to have the complement of banned_cpus available so that -@@ -158,6 +159,8 @@ - memset(cpu, 0, sizeof(struct cpu_core)); - - cpu->number = strtoul(&path[27], NULL, 10); -+ -+ cpu_set(cpu->number, cpu_possible_map); - - cpu_set(cpu->number, cpu->mask); - -@@ -219,15 +222,15 @@ - core_count++; - } - --static void dump_irqs(int spaces, GList *interrupts) -+static void dump_irqs(int spaces, GList *dump_interrupts) - { - struct interrupt *irq; -- while (interrupts) { -+ while (dump_interrupts) { - int i; -- for (i=0; idata; -+ for (i=0; idata; - printf("Interrupt %i (%s/%u) \n", irq->number, classes[irq->class], (unsigned int)irq->workload); -- interrupts = g_list_next(interrupts); -+ dump_interrupts = g_list_next(dump_interrupts); - } - } - -Index: placement.c -=================================================================== ---- placement.c (.../tags/irqbalance-0.56) (revision 33) -+++ placement.c (.../trunk) (revision 33) -@@ -272,7 +272,7 @@ - } - if ((!cpus_empty(irq->node_mask)) && - (!cpus_equal(irq->mask, irq->node_mask)) && -- (!cpus_full(irq->node_mask))) { -+ (!__cpus_full(&irq->node_mask, num_possible_cpus()))) { - irq->old_mask = irq->mask; - irq->mask = irq->node_mask; - } -Index: cpumask.h -=================================================================== ---- cpumask.h (.../tags/irqbalance-0.56) (revision 33) -+++ cpumask.h (.../trunk) (revision 33) -@@ -1,7 +1,7 @@ - #ifndef __LINUX_CPUMASK_H - #define __LINUX_CPUMASK_H - --#define NR_CPUS 256 -+#define NR_CPUS 4096 - /* - * Cpumasks provide a bitmap suitable for representing the - * set of CPU's in a system, one bit position per CPU number. -Index: bitmap.c -=================================================================== ---- bitmap.c (.../tags/irqbalance-0.56) (revision 33) -+++ bitmap.c (.../trunk) (revision 33) -@@ -74,6 +74,19 @@ - return 1; - } - -+int __bitmap_weight(const unsigned long *bitmap, int bits) -+{ -+ int k, w = 0, lim = bits/BITS_PER_LONG; -+ -+ for (k = 0; k < lim; k++) -+ w += hweight_long(bitmap[k]); -+ -+ if (bits % BITS_PER_LONG) -+ w += hweight_long(bitmap[k] & BITMAP_LAST_WORD_MASK(bits)); -+ -+ return w; -+} -+ - int __bitmap_equal(const unsigned long *bitmap1, - const unsigned long *bitmap2, int bits) - { -Index: irqlist.c -=================================================================== ---- irqlist.c (.../tags/irqbalance-0.56) (revision 33) -+++ irqlist.c (.../trunk) (revision 33) -@@ -28,6 +28,7 @@ - #include - #include - #include -+#include - - #include "types.h" - #include "irqbalance.h" -@@ -39,6 +40,7 @@ - void get_affinity_hint(struct interrupt *irq, int number) - { - char buf[PATH_MAX]; -+ cpumask_t tempmask; - char *line = NULL; - size_t size = 0; - FILE *file; -@@ -51,7 +53,9 @@ - fclose(file); - return; - } -- cpumask_parse_user(line, strlen(line), irq->node_mask); -+ cpumask_parse_user(line, strlen(line), tempmask); -+ if (!__cpus_full(&tempmask, num_possible_cpus())) -+ irq->node_mask = tempmask; - fclose(file); - free(line); - } -@@ -64,7 +68,7 @@ - DIR *dir; - struct dirent *entry; - char *c, *c2; -- int nr , count = 0; -+ int nr , count = 0, can_set = 1; - char buf[PATH_MAX]; - sprintf(buf, "/proc/irq/%i", number); - dir = opendir(buf); -@@ -77,7 +81,7 @@ - size_t size = 0; - FILE *file; - sprintf(buf, "/proc/irq/%i/smp_affinity", number); -- file = fopen(buf, "r"); -+ file = fopen(buf, "r+"); - if (!file) - continue; - if (getline(&line, &size, file)==0) { -@@ -86,7 +90,13 @@ - continue; - } - cpumask_parse_user(line, strlen(line), irq->mask); -- fclose(file); -+ /* -+ * Check that we can write the affinity, if -+ * not take it out of the list. -+ */ -+ fputs(line, file); -+ if (fclose(file) && errno == EIO) -+ can_set = 0; - free(line); - } else if (strcmp(entry->d_name,"allowed_affinity")==0) { - char *line = NULL; -@@ -119,7 +129,7 @@ - count++; - - /* if there is no choice in the allowed mask, don't bother to balance */ -- if (count<2) -+ if ((count<2) || (can_set == 0)) - irq->balance_level = BALANCE_NONE; - - -Index: Makefile.am -=================================================================== ---- Makefile.am (.../tags/irqbalance-0.56) (revision 33) -+++ Makefile.am (.../trunk) (revision 33) -@@ -21,7 +21,7 @@ - # - - AUTOMAKE_OPTIONS = no-dependencies --EXTRA_DIST = README INSTALL COPYING autogen.sh m4/cap-ng.m4 -+EXTRA_DIST = README INSTALL COPYING autogen.sh cap-ng.m4 - - INCLUDES = -I${top_srcdir} - LIBS = $(CAPNG_LDADD) $(GLIB_LIBS) -@@ -31,6 +31,7 @@ - sbin_PROGRAMS = irqbalance - irqbalance_SOURCES = activate.c bitmap.c classify.c cputree.c irqbalance.c \ - irqlist.c network.c numa.c placement.c powermode.c procinterrupts.c -+dist_man_MANS = irqbalance.1 - - CONFIG_CLEAN_FILES = debug*.list config/* - clean-generic: -Index: network.c -=================================================================== ---- network.c (.../tags/irqbalance-0.56) (revision 33) -+++ network.c (.../trunk) (revision 33) -@@ -160,10 +160,8 @@ - } - - while (!feof(file)) { -- uint64_t rxcount; -- uint64_t txcount; -- uint64_t delta; -- int dummy; -+ uint64_t dummy __attribute__((unused)); -+ uint64_t rxcount, txcount, delta; - char *c, *c2; - if (getline(&line, &size, file)==0) - break; -- cgit v1.2.3-54-g00ecf