Resolves: bz 746159

Note: Committed upstream as a81cd26ab4d4a09f3345b2b391a12ee39af676b2
This commit is contained in:
Neil Horman 2011-10-17 14:51:21 -04:00
parent 69ea77e231
commit b1b570c5ce
2 changed files with 52 additions and 1 deletions

View File

@ -0,0 +1,46 @@
diff --git a/numa.c b/numa.c
index 6e00243..0d93091 100644
--- a/numa.c
+++ b/numa.c
@@ -84,6 +84,14 @@ void build_numa_node_list(void)
DIR *dir = opendir(SYSFS_NODE_PATH);
struct dirent *entry;
+ /*
+ * Add the unspecified node
+ */
+ numa_nodes = g_list_append(numa_nodes, &unspecified_node);
+
+ if (!dir)
+ return;
+
do {
entry = readdir(dir);
if (!entry)
@@ -96,6 +104,9 @@ void build_numa_node_list(void)
static void free_numa_node(gpointer data)
{
+ if (data == (void *)(&unspecified_node))
+ return;
+
free(data);
}
diff --git a/placement.c b/placement.c
index a5b976b..113891b 100644
--- a/placement.c
+++ b/placement.c
@@ -46,6 +46,12 @@ static void find_best_object(struct topo_obj *d, void *data)
cpumask_t subset;
/*
+ * Don't consider the unspecified numa node here
+ */
+ if ((d->obj_type == OBJ_TYPE_NODE) && (d->number == -1))
+ return;
+
+ /*
* If the hint policy is subset, then we only want
* to consider objects that are within the irqs hint, but
* only if that irq in fact has published a hint

View File

@ -1,6 +1,6 @@
Name: irqbalance
Version: 1.0
Release: 1%{?dist}
Release: 2%{?dist}
Epoch: 2
Summary: IRQ balancing daemon
@ -9,6 +9,7 @@ License: GPLv2
Url: http://irqbalance.org/
Source0: http://irqbalance.googlecode.com/files/irqbalance-%{version}.tbz2
Source1: irqbalance.sysconfig
Patch0: irqbalance-bz746159-no-numa-nodes.patch
BuildRequires: autoconf automake libtool libcap-ng
BuildRequires: glib2-devel pkgconfig imake libcap-ng-devel numactl-devel
@ -26,6 +27,7 @@ multiple CPUs for enhanced performance.
%prep
%setup -q -n irqbalance
%patch0 -p1
%build
sh ./autogen.sh
@ -75,6 +77,9 @@ fi
/sbin/chkconfig --del irqbalance >/dev/null 2>&1 || :
%changelog
* Mon Oct 17 2011 Neil Horman <nhorman@redhat.com> - 2:1.0-2
- Fix crash for systems with no numa node support
* Wed Oct 12 2011 Neil Horman <nhorman@redhat.com> - 2:1.0-1
- Update irqbalance to latest upstream version