-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: https://irqbalance.googlecode.com/svn/trunk@2 46b42954-3823-0410-bd82-eb80b452c9b5
- Loading branch information
arjanvandeven
committed
Dec 9, 2006
1 parent
f34ec17
commit 95f9881
Showing
19 changed files
with
3,689 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
CFLAGS+=-g -Os -D_FORTIFY_SOURCE=2 -Wall -W `pkg-config --cflags 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 | ||
|
||
clean: | ||
rm -f irqbalance *~ *.o .depend | ||
|
||
# rule for building dependency lists, and writing them to a file | ||
# named ".depend". | ||
.depend: | ||
rm -f .depend | ||
gccmakedep -f- -- $(CFLAGS) -- *.c > .depend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright (C) 2006, Intel Corporation | ||
* | ||
* This file is part of irqbalance | ||
* | ||
* This program file is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; version 2 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program in a file named COPYING; if not, write to the | ||
* Free Software Foundation, Inc., | ||
* 51 Franklin Street, Fifth Floor, | ||
* Boston, MA 02110-1301 USA | ||
*/ | ||
|
||
/* | ||
* This file contains the code to communicate a selected distribution / mapping | ||
* of interrupts to the kernel. | ||
*/ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <unistd.h> | ||
#include <stdint.h> | ||
|
||
#include "irqbalance.h" | ||
|
||
|
||
void activate_mapping(void) | ||
{ | ||
struct interrupt *irq; | ||
GList *iter; | ||
|
||
iter = g_list_first(interrupts); | ||
while (iter) { | ||
irq = iter->data; | ||
iter = g_list_next(iter); | ||
|
||
if (!cpus_equal(irq->mask, irq->old_mask)) { | ||
char buf[PATH_MAX]; | ||
FILE *file; | ||
sprintf(buf, "/proc/irq/%i/smp_affinity", irq->number); | ||
file = fopen(buf, "w"); | ||
if (!file) | ||
continue; | ||
cpumask_scnprintf(buf, PATH_MAX, irq->mask); | ||
fprintf(file,"%s", buf); | ||
fclose(file); | ||
irq->old_mask = irq->mask; | ||
} | ||
} | ||
} |
Oops, something went wrong.