This commit is contained in:
parent
2c433ddb0f
commit
126b5497c2
@ -8,7 +8,7 @@
|
|||||||
#
|
#
|
||||||
### BEGIN INIT INFO
|
### BEGIN INIT INFO
|
||||||
# Provides: irqbalance
|
# Provides: irqbalance
|
||||||
# Required-Start:
|
# Required-Start: $remote_fs
|
||||||
# X-UnitedLinux-Should-Start:
|
# X-UnitedLinux-Should-Start:
|
||||||
# Required-Stop:
|
# Required-Stop:
|
||||||
# X-UnitedLinux-Should-Stop:
|
# X-UnitedLinux-Should-Stop:
|
||||||
@ -28,6 +28,7 @@ IRQBALANCE_BIN=/usr/sbin/irqbalance
|
|||||||
test -x $IRQBALANCE_BIN || exit 5
|
test -x $IRQBALANCE_BIN || exit 5
|
||||||
PHYS=$(grep '^physical id' /proc/cpuinfo | sort -u | wc -l)
|
PHYS=$(grep '^physical id' /proc/cpuinfo | sort -u | wc -l)
|
||||||
PROC=$(grep -c '^processor' /proc/cpuinfo)
|
PROC=$(grep -c '^processor' /proc/cpuinfo)
|
||||||
|
TIMER_IRQ=$(cat /proc/interrupts |grep timer | cut -f 1 -d ':' | sed -e 's/ \+//g')
|
||||||
|
|
||||||
. /etc/rc.status
|
. /etc/rc.status
|
||||||
|
|
||||||
@ -38,6 +39,9 @@ case "$1" in
|
|||||||
start)
|
start)
|
||||||
echo -n "Starting irqbalance "
|
echo -n "Starting irqbalance "
|
||||||
if [ $PHYS -gt 1 ] || [ $PROC -gt 1 -a $PHYS -eq 0 ] ; then
|
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
|
startproc $IRQBALANCE_BIN
|
||||||
# Remember status and be verbose
|
# Remember status and be verbose
|
||||||
rc_status -v
|
rc_status -v
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:dd6cfe439c7e347ae60e0b950402cb4434f39b7e01261900b6daddcf21522112
|
|
||||||
size 10523
|
|
3
irqbalance-0.55.tar.bz2
Normal file
3
irqbalance-0.55.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:5dfafb5c8825346f886873a4ac34fd356af66ae3c87e935ef97f83b10e2ffa30
|
||||||
|
size 19055
|
@ -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);
|
|
21
irqbalance-fix-Makefile
Normal file
21
irqbalance-fix-Makefile
Normal file
@ -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
|
@ -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[];
|
|
@ -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[];
|
|
@ -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
|
Tue Apr 3 11:31:56 CEST 2007 - bwalle@suse.de
|
||||||
|
|
||||||
|
@ -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.
|
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||||
# This file and all modifications and additions to the pristine
|
# This file and all modifications and additions to the pristine
|
||||||
@ -15,15 +15,16 @@ License: GNU General Public License (GPL)
|
|||||||
Group: System/Daemons
|
Group: System/Daemons
|
||||||
Autoreqprov: on
|
Autoreqprov: on
|
||||||
PreReq: %insserv_prereq
|
PreReq: %insserv_prereq
|
||||||
Version: 0.09
|
Version: 0.55
|
||||||
Release: 91
|
Release: 1
|
||||||
Summary: Balance IRQs on SMP Machines
|
Summary: Balance IRQs on SMP Machines
|
||||||
Source: %{name}-%{version}.tar.gz
|
Source: %{name}-%{version}.tar.bz2
|
||||||
Source2: irq_balancer
|
Source2: irq_balancer
|
||||||
|
URL: http://www.irqbalance.org
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
Patch0: irqbalance-increase-limits
|
# xorg-x11-util-devel is for gccmakedep
|
||||||
Patch1: irqbalance-increase-limits2
|
BuildRequires: glib2-devel xorg-x11-util-devel
|
||||||
Patch2: irqbalance-assert.diff
|
Patch0: irqbalance-fix-Makefile
|
||||||
|
|
||||||
%description
|
%description
|
||||||
irqbalance dynamically switches the CPUs for IRQs to prevent cpu0 from
|
irqbalance dynamically switches the CPUs for IRQs to prevent cpu0 from
|
||||||
@ -33,26 +34,21 @@ being used for all IRQs.
|
|||||||
|
|
||||||
Authors:
|
Authors:
|
||||||
--------
|
--------
|
||||||
Arjan van de Ven <arjanv@redhat.com>
|
Arjan van de Ven <arjan@linux.intel.com>
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -n irqbalance
|
%setup
|
||||||
%patch0 -p1
|
%patch0 -p1
|
||||||
%patch1
|
|
||||||
%patch2 -p1
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
rm -rf $RPM_BUILD_ROOT
|
|
||||||
make CFLAGS="$RPM_OPT_FLAGS -fPIE -pie"
|
make CFLAGS="$RPM_OPT_FLAGS -fPIE -pie"
|
||||||
|
|
||||||
%install
|
%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/etc/init.d
|
||||||
mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1/
|
install -m 0755 irqbalance $RPM_BUILD_ROOT/%{_sbindir}
|
||||||
cp irqbalance $RPM_BUILD_ROOT/usr/sbin
|
install -m 0755 $RPM_SOURCE_DIR/irq_balancer $RPM_BUILD_ROOT/etc/init.d
|
||||||
cp $RPM_SOURCE_DIR/irq_balancer $RPM_BUILD_ROOT/etc/init.d
|
ln -s /etc/init.d/irq_balancer $RPM_BUILD_ROOT/%{_sbindir}/rcirq_balancer
|
||||||
ln -s /etc/init.d/irq_balancer $RPM_BUILD_ROOT/usr/sbin/rcirq_balancer
|
|
||||||
cp irqbalance.1 $RPM_BUILD_ROOT/usr/share/man/man1/
|
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
@ -69,12 +65,20 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
/usr/sbin/irqbalance
|
%{_sbindir}/irqbalance
|
||||||
/etc/init.d/irq_balancer
|
/etc/init.d/irq_balancer
|
||||||
/usr/sbin/rcirq_balancer
|
%{_sbindir}/rcirq_balancer
|
||||||
/usr/share/man/*/*
|
|
||||||
|
|
||||||
%changelog
|
%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
|
* Tue Apr 03 2007 - bwalle@suse.de
|
||||||
- increased IRQ number to (256 + (32*MAX_CPU)) as done in the
|
- increased IRQ number to (256 + (32*MAX_CPU)) as done in the
|
||||||
x86_64 kernel
|
x86_64 kernel
|
||||||
|
Loading…
x
Reference in New Issue
Block a user