Browse Source

Unfinished pxm

Serj Kalichev 10 years ago
parent
commit
702b1586b2
7 changed files with 44 additions and 644 deletions
  1. 6 4
      Makefile.am
  2. 37 3
      birq.c
  3. 0 216
      cpu_parse.c
  4. 1 1
      irq.h
  5. 0 317
      irq_parse.c
  6. 0 97
      proximity.c
  7. 0 6
      proximity.h

+ 6 - 4
Makefile.am

@@ -20,18 +20,20 @@ noinst_HEADERS = \
 	cpumask.h \
 	irq.h \
 	cpu.h \
+	numa.h \
 	statistics.h \
 	balance.h \
-	proximity.h
+	pxm.h
 
 birq_SOURCES = \
 	birq.c \
 	bitmap.c \
-	irq_parse.c \
-	cpu_parse.c \
+	irq.c \
+	cpu.c \
+	numa.c \
 	statistics.c \
 	balance.c \
-	proximity.c
+	pxm.c
 
 birq_LDADD = liblub.a
 birq_DEPENDENCIES = liblub.a

+ 37 - 3
birq.c

@@ -28,9 +28,11 @@
 #include "lub/log.h"
 #include "lub/list.h"
 #include "irq.h"
+#include "numa.h"
 #include "cpu.h"
 #include "statistics.h"
 #include "balance.h"
+#include "pxm.h"
 
 #ifndef VERSION
 #define VERSION "1.0.0"
@@ -48,6 +50,7 @@ static int opts_parse(int argc, char *argv[], struct options *opts);
 /* Command line options */
 struct options {
 	char *pidfile;
+	char *pxm; /* Proximity config file */
 	int debug; /* Don't daemonize in debug mode */
 	int log_facility;
 	float threshold;
@@ -76,6 +79,10 @@ int main(int argc, char **argv)
 	lub_list_t *balance_irqs;
 	/* CPU list. It contain all found CPUs. */
 	lub_list_t *cpus;
+	/* NUMA list. It contain all found NUMA nodes. */
+	lub_list_t *numas;
+	/* Proximity list. */
+	lub_list_t *pxms;
 
 	/* Parse command line options */
 	opts = opts_init();
@@ -126,14 +133,29 @@ int main(int argc, char **argv)
 	/* Randomize */
 	srand(time(NULL));
 
+	/* Scan NUMA nodes */
+	numas = lub_list_new(numa_list_compare);
+	scan_numas(numas);
+	if (opts->verbose)
+		show_numas(numas);
+
 	/* Scan CPUs */
 	cpus = lub_list_new(cpu_list_compare);
 	scan_cpus(cpus, opts->ht);
+	if (opts->verbose)
+		show_cpus(cpus);
 
 	/* Prepare data structures */
 	irqs = lub_list_new(irq_list_compare);
 	balance_irqs = lub_list_new(irq_list_compare);
 
+	/* Parse proximity file */
+	pxms = lub_list_new(NULL);
+	if (opts->pxm)
+		parse_pxm_config(opts->pxm, pxms, numas);
+	if (opts->verbose)
+		show_pxms(pxms);
+
 	/* Set period */
 	interval = opts->short_interval;
 
@@ -150,7 +172,7 @@ int main(int argc, char **argv)
 		printf("----[ %s ]----------------------------------------------------------------\n", outstr);
 
 		/* Rescan PCI devices for new IRQs. */
-		scan_irqs(irqs, balance_irqs);
+		scan_irqs(irqs, balance_irqs, pxms);
 		if (opts->verbose)
 			irq_list_show(irqs);
 
@@ -189,6 +211,8 @@ int main(int argc, char **argv)
 	irq_list_free(irqs);
 	lub_list_free(balance_irqs);
 	cpu_list_free(cpus);
+	numa_list_free(numas);
+	pxm_list_free(pxms);
 
 	retval = 0;
 err:
@@ -226,6 +250,7 @@ static struct options *opts_init(void)
 	assert(opts);
 	opts->debug = 0; /* daemonize by default */
 	opts->pidfile = strdup(BIRQ_PIDFILE);
+	opts->pxm = NULL;
 	opts->log_facility = LOG_DAEMON;
 	opts->threshold = BIRQ_DEFAULT_THRESHOLD;
 	opts->verbose = 0;
@@ -243,6 +268,8 @@ static void opts_free(struct options *opts)
 {
 	if (opts->pidfile)
 		free(opts->pidfile);
+	if (opts->pxm)
+		free(opts->pxm);
 	free(opts);
 }
 
@@ -250,7 +277,7 @@ static void opts_free(struct options *opts)
 /* Parse command line options */
 static int opts_parse(int argc, char *argv[], struct options *opts)
 {
-	static const char *shortopts = "hp:dO:t:vri:I:c:";
+	static const char *shortopts = "hp:dO:t:vri:I:s:x:";
 #ifdef HAVE_GETOPT_H
 	static const struct option longopts[] = {
 		{"help",		0, NULL, 'h'},
@@ -262,7 +289,8 @@ static int opts_parse(int argc, char *argv[], struct options *opts)
 		{"ht",			0, NULL, 'r'},
 		{"short-interval",	1, NULL, 'i'},
 		{"long-interval",	1, NULL, 'i'},
-		{"choose",		1, NULL, 'c'},
+		{"strategy",		1, NULL, 's'},
+		{"pxm",			1, NULL, 'x'},
 		{NULL,			0, NULL, 0}
 	};
 #endif
@@ -282,6 +310,11 @@ static int opts_parse(int argc, char *argv[], struct options *opts)
 				free(opts->pidfile);
 			opts->pidfile = strdup(optarg);
 			break;
+		case 'x':
+			if (opts->pxm)
+				free(opts->pxm);
+			opts->pxm = strdup(optarg);
+			break;
 		case 'd':
 			opts->debug = 1;
 			break;
@@ -387,6 +420,7 @@ static void help(int status, const char *argv0)
 		printf("\t-v, --verbose\tBe verbose.\n");
 		printf("\t-r, --ht\tEnable hyper-threading. Not recommended.\n");
 		printf("\t-p <path>, --pid=<path>\tFile to save daemon's PID to.\n");
+		printf("\t-x <path>, --pxm=<path>\tProximity config file.\n");
 		printf("\t-O, --facility\tSyslog facility. Default is DAEMON.\n");
 		printf("\t-t <float>, --threshold=<float>\tThreshold to consider CPU is overloaded, in percents.\n");
 		printf("\t-i <sec>, --short-interval=<sec>\tShort iteration interval.\n");

+ 0 - 216
cpu_parse.c

@@ -1,216 +0,0 @@
-/* cpu_parse.c
- * Parse CPU-related files.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <dirent.h>
-#include <limits.h>
-#include <ctype.h>
-#include <unistd.h>
-
-#include "lub/list.h"
-#include "cpumask.h"
-#include "cpu.h"
-#include "irq.h"
-
-int cpu_list_compare(const void *first, const void *second)
-{
-	const cpu_t *f = (const cpu_t *)first;
-	const cpu_t *s = (const cpu_t *)second;
-	return (f->id - s->id);
-}
-
-int cpu_list_compare_len(const void *first, const void *second)
-{
-	const cpu_t *f = (const cpu_t *)first;
-	const cpu_t *s = (const cpu_t *)second;
-	return (lub_list_len(f->irqs) - lub_list_len(s->irqs));
-}
-
-static cpu_t * cpu_new(unsigned int id)
-{
-	cpu_t *new;
-
-	if (!(new = malloc(sizeof(*new))))
-		return NULL;
-	new->id = id;
-	new->old_load_all = 0;
-	new->old_load_irq = 0;
-	new->old_load = 0;
-	new->load = 0;
-	new->irqs = lub_list_new(irq_list_compare);
-	cpus_clear(new->cpumask);
-	cpu_set(new->id, new->cpumask);
-
-	return new;
-}
-
-static void cpu_free(cpu_t *cpu)
-{
-	lub_list_node_t *node;
-
-	while ((node = lub_list__get_tail(cpu->irqs))) {
-		lub_list_del(cpu->irqs, node);
-		lub_list_node_free(node);
-	}
-	lub_list_free(cpu->irqs);
-	free(cpu);
-}
-
-/* Search for CPU with specified package and core IDs.
-   The second CPU with the same IDs is a thread of Hyper Threading.
-   We don't want to use HT for IRQ balancing. */
-static cpu_t * cpu_list_search_ht(lub_list_t *cpus,
-	unsigned int package_id, unsigned int core_id,
-	cpumask_t thread_siblings)
-{
-	lub_list_node_t *iter;
-
-	/* Check if current CPU has thread siblings */
-	/* The CPUs without thread siblings has no hyper
-	   threading. For example some AMD processors has
-	   two CPUs with the same package and core ids but
-	   has no thread siblings. Don't consider such CPUs as
-	   a hyper threading. */
-	if (cpus_weight(thread_siblings) < 2)
-		return NULL;
-
-	for (iter = lub_list_iterator_init(cpus); iter;
-		iter = lub_list_iterator_next(iter)) {
-		cpu_t *cpu;
-		cpu = (cpu_t *)lub_list_node__get_data(iter);
-		if (cpu->package_id != package_id)
-			continue;
-		if (cpu->core_id != core_id)
-			continue;
-		return cpu;
-	}
-
-	return NULL;
-}
-
-cpu_t * cpu_list_search(lub_list_t *cpus, unsigned int id)
-{
-	lub_list_node_t *node;
-	cpu_t search;
-
-	search.id = id;
-	node = lub_list_search(cpus, &search);
-	if (!node)
-		return NULL;
-	return (cpu_t *)lub_list_node__get_data(node);
-}
-
-static cpu_t * cpu_list_add(lub_list_t *cpus, cpu_t *cpu)
-{
-	cpu_t *old = cpu_list_search(cpus, cpu->id);
-
-	if (old) /* CPU already exists. May be renew some fields later */
-		return old;
-	lub_list_add(cpus, cpu);
-
-	return cpu;
-}
-
-int cpu_list_free(lub_list_t *cpus)
-{
-	lub_list_node_t *iter;
-	while ((iter = lub_list__get_head(cpus))) {
-		cpu_t *cpu;
-		cpu = (cpu_t *)lub_list_node__get_data(iter);
-		cpu_free(cpu);
-		lub_list_del(cpus, iter);
-		lub_list_node_free(iter);
-	}
-	lub_list_free(cpus);
-	return 0;
-}
-
-/* Show CPU information */
-static void show_cpu_info(cpu_t *cpu)
-{
-	char buf[NR_CPUS + 1];
-	cpumask_scnprintf(buf, sizeof(buf), cpu->cpumask);
-	printf("CPU %d package %d core %d mask %s\n", cpu->id, cpu->package_id, cpu->core_id, buf);
-}
-
-/* Show CPU list */
-int show_cpus(lub_list_t *cpus)
-{
-	lub_list_node_t *iter;
-	for (iter = lub_list_iterator_init(cpus); iter;
-		iter = lub_list_iterator_next(iter)) {
-		cpu_t *cpu;
-		cpu = (cpu_t *)lub_list_node__get_data(iter);
-		show_cpu_info(cpu);
-	}
-	return 0;
-}
-
-/* Search for CPUs */
-int scan_cpus(lub_list_t *cpus, int ht)
-{
-	FILE *fd;
-	char path[PATH_MAX];
-	unsigned int id;
-	unsigned int package_id;
-	unsigned int core_id;
-	cpu_t *new;
-	char *str = NULL;
-	size_t sz;
-	cpumask_t thread_siblings;
-
-	for (id = 0; id < NR_CPUS; id++) {
-		sprintf(path, "%s/cpu%d", SYSFS_CPU_PATH, id);
-		if (access(path, F_OK))
-			break;
-
-		/* Try to get package_id */
-		sprintf(path, "%s/cpu%d/topology/physical_package_id",
-			SYSFS_CPU_PATH, id);
-		if (!(fd = fopen(path, "r")))
-			continue;
-		if (fscanf(fd, "%u", &package_id) < 0) {
-			fclose(fd);
-			continue;
-		}
-		fclose(fd);
-
-		/* Try to get core_id */
-		sprintf(path, "%s/cpu%d/topology/core_id",
-			SYSFS_CPU_PATH, id);
-		if (!(fd = fopen(path, "r")))
-			continue;
-		if (fscanf(fd, "%u", &core_id) < 0) {
-			fclose(fd);
-			continue;
-		}
-		fclose(fd);
-
-		/* Get thread siblings */
-		cpus_clear(thread_siblings);
-		cpu_set(id, thread_siblings);
-		sprintf(path, "%s/cpu%d/topology/thread_siblings",
-			SYSFS_CPU_PATH, id);
-		if ((fd = fopen(path, "r"))) {
-			if (getline(&str, &sz, fd) >= 0)
-				cpumask_parse_user(str, strlen(str), thread_siblings);
-			fclose(fd);
-		}
-
-		/* Don't use second thread of Hyper Threading */
-		if (!ht && cpu_list_search_ht(cpus, package_id, core_id, thread_siblings))
-			continue;
-
-		new = cpu_new(id);
-		new->package_id = package_id;
-		new->core_id = core_id;
-		cpu_list_add(cpus, new);
-	}
-	free(str);
-
-	return 0;
-}

+ 1 - 1
irq.h

@@ -27,7 +27,7 @@ typedef struct irq_s irq_t;
 int irq_list_compare(const void *first, const void *second);
 
 /* IRQ list functions */
-int scan_irqs(lub_list_t *irqs, lub_list_t *balance_irqs);
+int scan_irqs(lub_list_t *irqs, lub_list_t *balance_irqs, lub_list_t *pxms);
 int irq_list_free(lub_list_t *irqs);
 int irq_list_show(lub_list_t *irqs);
 irq_t * irq_list_search(lub_list_t *irqs, unsigned int num);

+ 0 - 317
irq_parse.c

@@ -1,317 +0,0 @@
-/* irq_parse.c
- * Parse IRQ-related files.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <dirent.h>
-#include <limits.h>
-#include <ctype.h>
-
-#include "lub/list.h"
-#include "irq.h"
-
-#define STR(str) ( str ? str : "" )
-
-int irq_list_compare(const void *first, const void *second)
-{
-	const irq_t *f = (const irq_t *)first;
-	const irq_t *s = (const irq_t *)second;
-	return (f->irq - s->irq);
-}
-
-static irq_t * irq_new(int num)
-{
-	irq_t *new;
-
-	if (!(new = malloc(sizeof(*new))))
-		return NULL;
-	new->irq = num;
-	new->type = NULL;
-	new->desc = NULL;
-	new->refresh = 1;
-	new->old_intr = 0;
-	new->intr = 0;
-	new->cpu = NULL;
-	new->weight = 0;
-	cpus_setall(new->local_cpus);
-	cpus_clear(new->affinity);
-	new->blacklisted = 0;
-
-	return new;
-}
-
-static void irq_free(irq_t *irq)
-{
-	free(irq->type);
-	free(irq->desc);
-	free(irq);
-}
-
-irq_t * irq_list_search(lub_list_t *irqs, unsigned int num)
-{
-	lub_list_node_t *node;
-	irq_t search;
-
-	search.irq = num;
-	node = lub_list_search(irqs, &search);
-	if (!node)
-		return NULL;
-	return (irq_t *)lub_list_node__get_data(node);
-}
-
-static irq_t * irq_list_add(lub_list_t *irqs, unsigned int num)
-{
-	lub_list_node_t *node;
-	irq_t *new;
-	irq_t search;
-
-	search.irq = num;
-	node = lub_list_search(irqs, &search);
-	if (node) /* IRQ already exists. May be renew some fields later */
-		return (irq_t *)lub_list_node__get_data(node);
-	if (!(new = irq_new(num)))
-		return NULL;
-	lub_list_add(irqs, new);
-
-	return new;
-}
-
-int irq_list_free(lub_list_t *irqs)
-{
-	lub_list_node_t *iter;
-	while ((iter = lub_list__get_head(irqs))) {
-		irq_t *irq;
-		irq = (irq_t *)lub_list_node__get_data(iter);
-		irq_free(irq);
-		lub_list_del(irqs, iter);
-		lub_list_node_free(iter);
-	}
-	lub_list_free(irqs);
-	return 0;
-}
-
-/* Show IRQ information */
-static void irq_show(irq_t *irq)
-{
-	char buf[NR_CPUS + 1];
-	if (cpus_full(irq->local_cpus))
-		snprintf(buf, sizeof(buf), "*");
-	else
-		cpumask_scnprintf(buf, sizeof(buf), irq->local_cpus);
-	printf("IRQ %3d %s [%s] %s\n", irq->irq, buf, STR(irq->type), STR(irq->desc));
-}
-
-/* Show IRQ list */
-int irq_list_show(lub_list_t *irqs)
-{
-	lub_list_node_t *iter;
-	for (iter = lub_list_iterator_init(irqs); iter;
-		iter = lub_list_iterator_next(iter)) {
-		irq_t *irq;
-		irq = (irq_t *)lub_list_node__get_data(iter);
-		irq_show(irq);
-	}
-	return 0;
-}
-
-static int parse_local_cpus(lub_list_t *irqs, const char *sysfs_path,
-	unsigned int num)
-{
-	char path[PATH_MAX];
-	FILE *fd;
-	char *str = NULL;
-	size_t sz;
-	irq_t *irq;
-	cpumask_t local_cpus;
-
-	irq = irq_list_search(irqs, num);
-	if (!irq)
-		return -1;
-
-	sprintf(path, "%s/%s/local_cpus", SYSFS_PCI_PATH, sysfs_path);
-	if (!(fd = fopen(path, "r")))
-		return -1;
-	if (getline(&str, &sz, fd) < 0) {
-		fclose(fd);
-		return -1;
-	}
-	fclose(fd);
-	cpumask_parse_user(str, strlen(str), local_cpus);
-	cpus_and(irq->local_cpus, irq->local_cpus, local_cpus);
-	free(str);
-
-	return 0;
-}
-
-static int parse_sysfs(lub_list_t *irqs)
-{
-	DIR *dir;
-	DIR *msi;
-	struct dirent *dent;
-	struct dirent *ment;
-	FILE *fd;
-	char path[PATH_MAX];
-	int num;
-
-	/* Now we can parse PCI devices only */
-	/* Get info from /sys/bus/pci/devices */
-	dir = opendir(SYSFS_PCI_PATH);
-	if (!dir)
-		return -1;
-	while((dent = readdir(dir))) {
-		if (!strcmp(dent->d_name, ".") ||
-			!strcmp(dent->d_name, ".."))
-			continue;
-
-		/* Search for MSI IRQs. Since linux-3.2 */
-		sprintf(path, "%s/%s/msi_irqs", SYSFS_PCI_PATH, dent->d_name);
-		if ((msi = opendir(path))) {
-			while((ment = readdir(msi))) {
-				if (!strcmp(ment->d_name, ".") ||
-					!strcmp(ment->d_name, ".."))
-					continue;
-				num = strtol(ment->d_name, NULL, 10);
-				if (!num)
-					continue;
-				parse_local_cpus(irqs, dent->d_name, num);
-			}
-			closedir(msi);
-			continue;
-		}
-
-		/* Try to get IRQ number from irq file */
-		sprintf(path, "%s/%s/irq", SYSFS_PCI_PATH, dent->d_name);
-		if (!(fd = fopen(path, "r")))
-			continue;
-		if (fscanf(fd, "%d", &num) < 0) {
-			fclose(fd);
-			continue;
-		}
-		fclose(fd);
-		if (!num)
-			continue;
-		parse_local_cpus(irqs, dent->d_name, num);
-	}
-	closedir(dir);
-
-	return 0;
-}
-
-int irq_get_affinity(irq_t *irq)
-{
-	char path[PATH_MAX];
-	FILE *fd;
-	char *str = NULL;
-	size_t sz;
-
-	if (!irq)
-		return -1;
-
-	sprintf(path, "%s/%u/smp_affinity", PROC_IRQ, irq->irq);
-	if (!(fd = fopen(path, "r")))
-		return -1;
-	if (getline(&str, &sz, fd) < 0) {
-		fclose(fd);
-		return -1;
-	}
-	fclose(fd);
-	cpumask_parse_user(str, strlen(str), irq->affinity);
-	free(str);
-
-	return 0;
-}
-
-
-/* Parse /proc/interrupts to get actual IRQ list */
-int scan_irqs(lub_list_t *irqs, lub_list_t *balance_irqs)
-{
-	FILE *fd;
-	unsigned int num;
-	char *str = NULL;
-	size_t sz;
-	irq_t *irq;
-	lub_list_node_t *iter;
-
-	if (!(fd = fopen(PROC_INTERRUPTS, "r")))
-		return -1;
-	while(getline(&str, &sz, fd) >= 0) {
-		char *endptr, *tok;
-		int new = 0;
-		num = strtoul(str, &endptr, 10);
-		if (endptr == str)
-			continue;
-		
-		if (!(irq = irq_list_search(irqs, num))) {
-			new = 1;
-			irq = irq_list_add(irqs, num);
-		}
-
-		/* Set refresh flag because IRQ was found */
-		irq->refresh = 1;
-
-		/* Doesn't refresh info for blacklisted IRQs */
-		if (irq->blacklisted)
-			continue;
-
-		/* Find IRQ type - first non-digital and non-space */
-		while (*endptr && !isalpha(*endptr))
-			endptr++;
-		tok = endptr; /* It will be IRQ type */
-		while (*endptr && !isblank(*endptr))
-			endptr++;
-		free(irq->type);
-		irq->type = strndup(tok, endptr - tok);
-
-		/* Find IRQ devices list */
-		while (*endptr && !isalpha(*endptr))
-			endptr++;
-		tok = endptr; /* It will be device list */
-		while (*endptr && !iscntrl(*endptr))
-			endptr++;
-		free(irq->desc);
-		irq->desc = strndup(tok, endptr - tok);
-
-		if (new) {
-			/* By default all CPUs are local for IRQ. Real local
-			   CPUs will be find while sysfs scan. */
-			cpus_setall(irq->local_cpus);
-
-			irq_get_affinity(irq);
-
-			lub_list_add(balance_irqs, irq);
-			printf("Add IRQ %3d %s\n", irq->irq, STR(irq->desc));
-		}
-	}
-	free(str);
-	fclose(fd);
-
-	/* Remove disapeared IRQs */
-	iter = lub_list_iterator_init(irqs);
-	while(iter) {
-		irq_t *irq;
-		lub_list_node_t *old_iter;
-		irq = (irq_t *)lub_list_node__get_data(iter);
-		old_iter = iter;
-		iter = lub_list_iterator_next(iter);
-		if (!irq->refresh) {
-			lub_list_del(irqs, old_iter);
-			irq_free(irq);
-			printf("Remove IRQ %3d %s\n", irq->irq, STR(irq->desc));
-		} else {
-			/* Drop refresh flag for next iteration */
-			irq->refresh = 0;
-		}
-	}
-
-	/* No new IRQs were found. It doesn't need to scan sysfs. */
-	if (lub_list_len(balance_irqs) == 0)
-		return 0;
-	/* Add IRQ info from sysfs */
-	parse_sysfs(irqs);
-
-	return 0;
-}
-

+ 0 - 97
proximity.c

@@ -1,97 +0,0 @@
-/* proximity.c
- * Parse manual proximity config.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <dirent.h>
-#include <limits.h>
-#include <ctype.h>
-
-#include "lub/list.h"
-#include "proximity.h"
-
-#define STR(str) ( str ? str : "" )
-
-int parse_pxm_config(const char *fname)
-{
-	FILE *file;
-	char *line = NULL;
-	size_t size = 0;
-	char *saveptr;
-
-	if (!fname)
-		return -1;
-	file = fopen(fname, "r");
-	if (!file)
-		return -1;
-
-	while (!feof(file)) {
-		if (getline(&line, &size, file) == 0)
-			break;
-printf("%s\n", line);
-/*		if (!strstr(line, "cpu"))
-			break;
-		cpunr = strtoul(&line[3], NULL, 10);
-
-		cpu = cpu_list_search(cpus, cpunr);
-		if (!cpu)
-			continue;
-
-		rc = sscanf(line, "%*s %llu %llu %llu %llu %llu %llu %llu %llu %llu %llu",
-			&l_user, &l_nice, &l_system, &l_idle, &l_iowait,
-			&l_irq, &l_softirq, &l_steal, &l_guest, &l_guest_nice);
-		if (rc < 2)
-			break;
-		cpucount++;
-
-		load_all = l_user + l_nice + l_system + l_idle + l_iowait +
-			l_irq + l_softirq + l_steal + l_guest + l_guest_nice;
-		load_irq = l_irq + l_softirq;
-
-		cpu->old_load = cpu->load;
-		if (cpu->old_load_all == 0) {
-			cpu->load = 0;
-		} else {
-			float d_all = (float)(load_all - cpu->old_load_all);
-			float d_irq = (float)(load_irq - cpu->old_load_irq);
-			cpu->load = d_irq * 100 / d_all;
-		}
-
-		cpu->old_load_all = load_all;
-		cpu->old_load_irq = load_irq;
-*/
-	}
-
-	/* Parse "intr" line. Get number of interrupts. */
-#if 0
-	strtok_r(line, " ", &saveptr);
-	strtok_r(NULL, " ", &saveptr); /* Total number of interrupts */
-	for (intr_str = strtok_r(NULL, " ", &saveptr);
-		intr_str; intr_str = strtok_r(NULL, " ", &saveptr)) {
-		unsigned long long intr = 0;
-		char *endptr;
-		irq_t *irq;
-		
-		irq = irq_list_search(irqs, inum);
-		inum++;
-		if (!irq)
-			continue;
-		intr = strtoull(intr_str, &endptr, 10);
-		if (endptr == intr_str)
-			intr = 0;
-		if (irq->old_intr == 0)
-			irq->intr = 0;
-		else
-			irq->intr = intr - irq->old_intr;
-		irq->old_intr = intr;
-	}
-#endif
-
-	fclose(file);
-	free(line);
-
-	return 0;
-}

+ 0 - 6
proximity.h

@@ -1,6 +0,0 @@
-#ifndef _proximity_h
-#define _proximity_h
-
-#include "cpumask.h"
-
-#endif