Skip to content
Permalink
Browse files

initial import

git-svn-id: https://irqbalance.googlecode.com/svn/trunk@2 46b42954-3823-0410-bd82-eb80b452c9b5
  • Loading branch information...
arjanvandeven
arjanvandeven committed Dec 9, 2006
1 parent f34ec17 commit 95f9881ff8d1032ae903bf700c17d6855bb1dacf
Showing with 3,689 additions and 0 deletions.
  1. +17 −0 Makefile
  2. +57 −0 activate.c
  3. +366 −0 bitmap.c
  4. +356 −0 bitmap.h
  5. +126 −0 classify.c
  6. +30 −0 constants.h
  7. +400 −0 cpumask.h
  8. +371 −0 cputree.c
  9. +138 −0 irqbalance.c
  10. +50 −0 irqbalance.h
  11. +252 −0 irqlist.c
  12. +175 −0 network.c
  13. +115 −0 non-atomic.h
  14. +101 −0 numa.c
  15. +315 −0 placement.c
  16. +75 −0 powermode.c
  17. +88 −0 procinterrupts.c
  18. +573 −0 strace
  19. +84 −0 types.h
@@ -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
@@ -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.

0 comments on commit 95f9881

Please sign in to comment.
You can’t perform that action at this time.