diff --git a/irq_balancer b/irq_balancer index 9750f4c..72efd90 100644 --- a/irq_balancer +++ b/irq_balancer @@ -8,7 +8,7 @@ # ### BEGIN INIT INFO # Provides: irqbalance -# Required-Start: +# Required-Start: $remote_fs # X-UnitedLinux-Should-Start: # Required-Stop: # X-UnitedLinux-Should-Stop: @@ -28,6 +28,7 @@ IRQBALANCE_BIN=/usr/sbin/irqbalance test -x $IRQBALANCE_BIN || exit 5 PHYS=$(grep '^physical id' /proc/cpuinfo | sort -u | wc -l) PROC=$(grep -c '^processor' /proc/cpuinfo) +TIMER_IRQ=$(cat /proc/interrupts |grep timer | cut -f 1 -d ':' | sed -e 's/ \+//g') . /etc/rc.status @@ -38,6 +39,9 @@ case "$1" in start) echo -n "Starting irqbalance " if [ $PHYS -gt 1 ] || [ $PROC -gt 1 -a $PHYS -eq 0 ] ; then + if [ -n "$TIMER_IRQ" ] ; then + export IRQBALANCE_BANNED_INTERRUPTS="$TIMER_IRQ" + fi startproc $IRQBALANCE_BIN # Remember status and be verbose rc_status -v diff --git a/irqbalance-0.09.tar.gz b/irqbalance-0.09.tar.gz deleted file mode 100644 index b41d36e..0000000 --- a/irqbalance-0.09.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dd6cfe439c7e347ae60e0b950402cb4434f39b7e01261900b6daddcf21522112 -size 10523 diff --git a/irqbalance-0.55.tar.bz2 b/irqbalance-0.55.tar.bz2 new file mode 100644 index 0000000..7d00631 --- /dev/null +++ b/irqbalance-0.55.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5dfafb5c8825346f886873a4ac34fd356af66ae3c87e935ef97f83b10e2ffa30 +size 19055 diff --git a/irqbalance-assert.diff b/irqbalance-assert.diff deleted file mode 100644 index 77fc95a..0000000 --- a/irqbalance-assert.diff +++ /dev/null @@ -1,45 +0,0 @@ -diff -urN irqbalance.orig/cpuinfo.c irqbalance/cpuinfo.c ---- irqbalance.orig/cpuinfo.c 2006-04-11 12:06:42.000000000 -0500 -+++ irqbalance/cpuinfo.c 2006-04-11 13:02:51.000000000 -0500 -@@ -37,16 +37,25 @@ - assert(file != NULL); - while (!feof(file) && cpucount < MAX_CPU) { - fgets(linebuffer, 1024, file); -- if (strstr(linebuffer,"Physical processor ID\t:")) -+ if (strstr(linebuffer,"Physical processor ID\t:")) { - sscanf(linebuffer,"Physical processor ID\t: %ui", &cpunumber[cpucount]); -+ assert(cpunumber[cpucount] < MAX_CPU); -+ } -+ - else if (strstr(linebuffer,"processor\t:")) - cpucount++; -- else if (strstr(linebuffer,"Number of siblings\t:")) -+ else if (strstr(linebuffer,"Number of siblings\t:")) { - sscanf(linebuffer,"Number of siblings \t: %i", &siblings[cpucount]); -- else if (strstr(linebuffer,"siblings\t:")) -+ assert(siblings[cpucount] < MAX_CPU); -+ } -+ else if (strstr(linebuffer,"siblings\t:")) { - sscanf(linebuffer,"siblings\t: %i", &siblings[cpucount]); -- else if (strstr(linebuffer,"physical id\t:")) -+ assert(siblings[cpucount] < MAX_CPU); -+ } -+ else if (strstr(linebuffer,"physical id\t:")) { - sscanf(linebuffer,"physical id\t: %ui", &cpunumber[cpucount]); -+ assert(cpunumber[cpucount] < MAX_CPU); -+ } - else if (strstr(linebuffer,"GenuineIntel")) { - if (!machineneedsbalance) - machineneedsbalance = 1; -Files irqbalance.orig/irqbalance and irqbalance/irqbalance differ -diff -urN irqbalance.orig/procinterrupts.c irqbalance/procinterrupts.c ---- irqbalance.orig/procinterrupts.c 2006-04-11 12:06:42.000000000 -0500 -+++ irqbalance/procinterrupts.c 2006-04-11 13:03:03.000000000 -0500 -@@ -102,6 +102,7 @@ - ret = sscanf(word,"%i",&irqnumber); - if (!ret) /* non numeric end stuff */ - irqnumber = MAX_INTERRUPTS-1; -+ assert(irqnumber < MAX_INTERRUPTS); - /* then N columns of counts, where N is the number of cpu's */ - } else if (column <= cpucount) { - sscanf(word,"%lli",&count); diff --git a/irqbalance-fix-Makefile b/irqbalance-fix-Makefile new file mode 100644 index 0000000..90b99e9 --- /dev/null +++ b/irqbalance-fix-Makefile @@ -0,0 +1,21 @@ +--- + Makefile | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- irqbalance-0.55.orig/Makefile ++++ irqbalance-0.55/Makefile +@@ -1,11 +1,12 @@ +-CFLAGS+=-g -Os -D_FORTIFY_SOURCE=2 -Wall -W `pkg-config --cflags glib-2.0` ++override CFLAGS+=-g -Os -D_FORTIFY_SOURCE=2 -Wall -W `pkg-config --cflags glib-2.0` ++override LDFLAGS += $(shell pkg-config --libs glib-2.0) + + all: irqbalance + + LIBS=bitmap.o irqbalance.o cputree.o procinterrupts.o irqlist.o placement.o activate.o network.o powermode.o numa.o classify.o + + irqbalance: .depend $(LIBS) +- gcc -g -O2 -D_FORTIFY_SOURCE=2 -Wall `pkg-config --libs glib-2.0` $(LIBS) -o irqbalance ++ gcc $(CFLAGS) $(LDFLAGS) $(LIBS) -o irqbalance + + clean: + rm -f irqbalance *~ *.o .depend diff --git a/irqbalance-increase-limits b/irqbalance-increase-limits deleted file mode 100644 index 3118d0a..0000000 --- a/irqbalance-increase-limits +++ /dev/null @@ -1,14 +0,0 @@ -diff -u irqbalance/prototypes.h~ irqbalance/prototypes.h ---- irqbalance/prototypes.h~ 2003-09-06 13:01:32.000000000 +0200 -+++ irqbalance/prototypes.h 2006-02-08 13:09:49.000000000 +0100 -@@ -25,8 +25,8 @@ - #define POLICY_ROTATE 1 - #define POLICY_IGNORE 2 - --#define MAX_CPU 32 --#define MAX_INTERRUPTS 256 -+#define MAX_CPU 128 -+#define MAX_INTERRUPTS 256 - - extern unsigned int cpubrother[]; - extern unsigned int class_policy[]; diff --git a/irqbalance-increase-limits2 b/irqbalance-increase-limits2 deleted file mode 100644 index 72b27b2..0000000 --- a/irqbalance-increase-limits2 +++ /dev/null @@ -1,17 +0,0 @@ ---- - prototypes.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: prototypes.h -=================================================================== ---- prototypes.h.orig -+++ prototypes.h -@@ -26,7 +26,7 @@ - #define POLICY_IGNORE 2 - - #define MAX_CPU 128 --#define MAX_INTERRUPTS 256 -+#define MAX_INTERRUPTS (256 + (32 * MAX_CPU)) - - extern unsigned int cpubrother[]; - extern unsigned int class_policy[]; diff --git a/irqbalance.changes b/irqbalance.changes index d7a4f4c..3d6b006 100644 --- a/irqbalance.changes +++ b/irqbalance.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Wed Apr 11 15:00:06 CEST 2007 - bwalle@suse.de + +- updated to irqbalance.org 0.55 + o rewrite from static arrays to dynamic lists using glib + o added IRQBALANCE_ONESHOT, IRQBALANCE_BANNED_INTERRUPTS + IRQBALANCE_BANNED_CPUS configuration environment variables +- changed init script to not balance the timer interrupt due to + broken hardware +- added $remote_fs to Required-Start since the binary needs + glib2 + ------------------------------------------------------------------- Tue Apr 3 11:31:56 CEST 2007 - bwalle@suse.de diff --git a/irqbalance.spec b/irqbalance.spec index a9d46a5..8e7f337 100644 --- a/irqbalance.spec +++ b/irqbalance.spec @@ -1,5 +1,5 @@ # -# spec file for package irqbalance (Version 0.09) +# spec file for package irqbalance (Version 0.55) # # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -15,15 +15,16 @@ License: GNU General Public License (GPL) Group: System/Daemons Autoreqprov: on PreReq: %insserv_prereq -Version: 0.09 -Release: 91 +Version: 0.55 +Release: 1 Summary: Balance IRQs on SMP Machines -Source: %{name}-%{version}.tar.gz +Source: %{name}-%{version}.tar.bz2 Source2: irq_balancer +URL: http://www.irqbalance.org BuildRoot: %{_tmppath}/%{name}-%{version}-build -Patch0: irqbalance-increase-limits -Patch1: irqbalance-increase-limits2 -Patch2: irqbalance-assert.diff +# xorg-x11-util-devel is for gccmakedep +BuildRequires: glib2-devel xorg-x11-util-devel +Patch0: irqbalance-fix-Makefile %description irqbalance dynamically switches the CPUs for IRQs to prevent cpu0 from @@ -33,26 +34,21 @@ being used for all IRQs. Authors: -------- - Arjan van de Ven + Arjan van de Ven %prep -%setup -n irqbalance +%setup %patch0 -p1 -%patch1 -%patch2 -p1 %build -rm -rf $RPM_BUILD_ROOT make CFLAGS="$RPM_OPT_FLAGS -fPIE -pie" %install -mkdir -p $RPM_BUILD_ROOT/usr/sbin +mkdir -p $RPM_BUILD_ROOT/%{_sbindir} mkdir -p $RPM_BUILD_ROOT/etc/init.d -mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1/ -cp irqbalance $RPM_BUILD_ROOT/usr/sbin -cp $RPM_SOURCE_DIR/irq_balancer $RPM_BUILD_ROOT/etc/init.d -ln -s /etc/init.d/irq_balancer $RPM_BUILD_ROOT/usr/sbin/rcirq_balancer -cp irqbalance.1 $RPM_BUILD_ROOT/usr/share/man/man1/ +install -m 0755 irqbalance $RPM_BUILD_ROOT/%{_sbindir} +install -m 0755 $RPM_SOURCE_DIR/irq_balancer $RPM_BUILD_ROOT/etc/init.d +ln -s /etc/init.d/irq_balancer $RPM_BUILD_ROOT/%{_sbindir}/rcirq_balancer %clean rm -rf $RPM_BUILD_ROOT @@ -69,12 +65,20 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) -/usr/sbin/irqbalance +%{_sbindir}/irqbalance /etc/init.d/irq_balancer -/usr/sbin/rcirq_balancer -/usr/share/man/*/* +%{_sbindir}/rcirq_balancer %changelog +* Wed Apr 11 2007 - bwalle@suse.de +- updated to irqbalance.org 0.55 + o rewrite from static arrays to dynamic lists using glib + o added IRQBALANCE_ONESHOT, IRQBALANCE_BANNED_INTERRUPTS + IRQBALANCE_BANNED_CPUS configuration environment variables +- changed init script to not balance the timer interrupt due to + broken hardware +- added $remote_fs to Required-Start since the binary needs + glib2 * Tue Apr 03 2007 - bwalle@suse.de - increased IRQ number to (256 + (32*MAX_CPU)) as done in the x86_64 kernel