irqbalance/irqbalance-bz748070-numa-pkg-assign.patch
2011-10-25 09:28:20 -04:00

52 lines
1.3 KiB
Diff

commit 1c4ad25a74b5b613b1d1972668bf41fc128420db
Author: Neil Horman <nhorman@tuxdriver.com>
Date: Mon Oct 24 10:15:49 2011 -0400
Ensure that packages get valid numa node:
On non-numa enabled systems, packages will get a NULL pointer to the
numa node, instead of the implied unspecified node structure. This
resutls in a segfaul. This should fix it.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
diff --git a/cputree.c b/cputree.c
index 31fefab..26a45db 100644
--- a/cputree.c
+++ b/cputree.c
@@ -228,7 +228,7 @@ static void do_one_cpu(char *path)
free(line);
}
- nodeid=0;
+ nodeid=-1;
dir = opendir(path);
do {
entry = readdir(dir);
diff --git a/numa.c b/numa.c
index 9cbbfc0..510fedc 100644
--- a/numa.c
+++ b/numa.c
@@ -127,19 +127,15 @@ static gint compare_node(gconstpointer a, gconstpointer b)
void add_package_to_node(struct topo_obj *p, int nodeid)
{
struct topo_obj find, *node;
- find.number = nodeid;
- GList *entry;
- find.number = nodeid;
- entry = g_list_find_custom(numa_nodes, &find, compare_node);
+ node = get_numa_node(nodeid);
- if (!entry) {
+ if (!node) {
if (debug_mode)
printf("Could not find numa node for node id %d\n", nodeid);
return;
}
- node = entry->data;
if (!p->parent) {
node->children = g_list_append(node->children, p);