From 067b127a853780b2b4ae7236dcdaaf72396dfa86 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 3 Jul 2011 23:10:20 +0000 Subject: Sun Jul 3 23:10:20 UTC 2011 --- .../Fix-detection-of-CPUs-in-sysfs.patch | 35 ++++ extra/irqbalance/PKGBUILD | 30 ++- ...errupt-counts-line-NMI-may-start-with-a-s.patch | 67 +++++++ extra/irqbalance/current-trunk.patch | 217 +++++++++++++++++++++ extra/qjackctl/PKGBUILD | 13 +- 5 files changed, 346 insertions(+), 16 deletions(-) create mode 100644 extra/irqbalance/Fix-detection-of-CPUs-in-sysfs.patch create mode 100644 extra/irqbalance/Special-interrupt-counts-line-NMI-may-start-with-a-s.patch create mode 100644 extra/irqbalance/current-trunk.patch (limited to 'extra') diff --git a/extra/irqbalance/Fix-detection-of-CPUs-in-sysfs.patch b/extra/irqbalance/Fix-detection-of-CPUs-in-sysfs.patch new file mode 100644 index 000000000..56bd529c2 --- /dev/null +++ b/extra/irqbalance/Fix-detection-of-CPUs-in-sysfs.patch @@ -0,0 +1,35 @@ +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/PKGBUILD b/extra/irqbalance/PKGBUILD index 13db8d06b..e969c5729 100644 --- a/extra/irqbalance/PKGBUILD +++ b/extra/irqbalance/PKGBUILD @@ -3,7 +3,7 @@ pkgname=irqbalance pkgver=0.56 -pkgrel=1 +pkgrel=3 pkgdesc="IRQ balancing daemon for SMP systems" arch=('i686' 'x86_64') url="http://www.irqbalance.org/" @@ -13,22 +13,32 @@ makedepends=(pkgconfig) backup=(etc/conf.d/irqbalance) source=(http://irqbalance.googlecode.com/files/irqbalance-$pkgver.tbz2 irqbalance.conf.d - irqbalance.rc.d) + irqbalance.rc.d + current-trunk.patch + Fix-detection-of-CPUs-in-sysfs.patch + Special-interrupt-counts-line-NMI-may-start-with-a-s.patch) md5sums=('cd0c4d3b2bb84778a04fc594ad83949a' '336c1ee99818f9ecda1687e34c69fd6b' - 'fb82fc5d267d39110baf720d81282a7c') + 'fb82fc5d267d39110baf720d81282a7c' + '64df09f54cf80d9ce5ff2751a882032d' + '00dcb394dac884c116657ade4fe623ee' + 'e774aff57054ce3c8b5adc7c3e5a74c2') build() { - cd $srcdir/$pkgname-$pkgver + cd "$srcdir/$pkgname-$pkgver" + patch -Np0 < ../current-trunk.patch + patch -Np1 < ../Fix-detection-of-CPUs-in-sysfs.patch + patch -Np1 < ../Special-interrupt-counts-line-NMI-may-start-with-a-s.patch ./autogen.sh - ./configure + ./configure --prefix=/usr make } package() { - cd $srcdir/$pkgname-$pkgver - install -D -m755 irqbalance $pkgdir/usr/sbin/irqbalance - install -D -m644 irqbalance.1 $pkgdir/usr/share/man/man1/irqbalance.1 - install -D -m644 ../irqbalance.conf.d $pkgdir/etc/conf.d/irqbalance - install -D -m755 ../irqbalance.rc.d $pkgdir/etc/rc.d/irqbalance + cd "$srcdir/$pkgname-$pkgver" + make install DESTDIR="$pkgdir" + #install -D -m755 irqbalance $pkgdir/usr/sbin/irqbalance + #install -D -m644 irqbalance.1 $pkgdir/usr/share/man/man1/irqbalance.1 + install -D -m644 ../irqbalance.conf.d "$pkgdir"/etc/conf.d/irqbalance + install -D -m755 ../irqbalance.rc.d "$pkgdir"/etc/rc.d/irqbalance } 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 new file mode 100644 index 000000000..c2e69c218 --- /dev/null +++ b/extra/irqbalance/Special-interrupt-counts-line-NMI-may-start-with-a-s.patch @@ -0,0 +1,67 @@ +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 new file mode 100644 index 000000000..83f08575c --- /dev/null +++ b/extra/irqbalance/current-trunk.patch @@ -0,0 +1,217 @@ +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; diff --git a/extra/qjackctl/PKGBUILD b/extra/qjackctl/PKGBUILD index 71cbf6664..1c28b8ae8 100644 --- a/extra/qjackctl/PKGBUILD +++ b/extra/qjackctl/PKGBUILD @@ -1,10 +1,10 @@ -# $Id: PKGBUILD 119703 2011-04-13 22:27:56Z schiv $ +# $Id: PKGBUILD 130089 2011-07-02 07:06:29Z schiv $ # Maintainer: Ray Rashif # Contributor: Tobias Kieslich pkgname=qjackctl -pkgver=0.3.7 -pkgrel=2 +pkgver=0.3.8 +pkgrel=1 pkgdesc="A Qt front-end for the JACK low-latency audio server" url="http://qjackctl.sourceforge.net/" arch=('i686' 'x86_64') @@ -12,19 +12,20 @@ license=('GPL') depends=('jack' 'qt') options=('!makeflags') source=("http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz") -md5sums=('3462613bd5c92fa6e6ae92950bd69c0b') +md5sums=('8a0992c01e50d8be22064ab7b08fbc78') build() { cd "$srcdir/$pkgname-$pkgver" - ./configure --prefix=/usr + ./configure --prefix=/usr + make } package() { cd "$srcdir/$pkgname-$pkgver" - make DESTDIR="$pkgdir/" install + make DESTDIR="$pkgdir" install } # vim:set ts=2 sw=2 et: -- cgit v1.2.3-54-g00ecf