Skip to content
Permalink
Browse files

fix balancing when numa information isn't available

Discovered a bug in which, when numa isn't available we failed to assign
the unspecified node to the device tree, leading us to not balance any
interrupts.  Make sure it gets added so irq get parsed down through the
tree to the proper topology node

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
  • Loading branch information...
Neil Horman authored and nhorman committed Feb 20, 2019
1 parent f5ca2eb commit 9f7b1a93150c6bb1f54a7bf5ce36b344f10cdf4a
Showing with 24 additions and 7 deletions.
  1. +19 −3 cputree.c
  2. +5 −4 placement.c
@@ -126,9 +126,10 @@ static void add_numa_node_to_topo_obj(struct topo_obj *obj, int nodeid)
GList *entry;
struct topo_obj *node;
struct topo_obj *cand_node;
struct topo_obj *package;

node = get_numa_node(nodeid);
if (!node || node->number == -1)
if (!node || (numa_avail && (node->number == -1)))
return;

entry = g_list_first(obj->numa_nodes);
@@ -141,6 +142,21 @@ static void add_numa_node_to_topo_obj(struct topo_obj *obj, int nodeid)

if (!entry)
obj->numa_nodes = g_list_append(obj->numa_nodes, node);

if (!numa_avail && obj->obj_type == OBJ_TYPE_PACKAGE) {
entry = g_list_first(node->children);
while (entry) {
package = entry->data;
if (package == obj)
break;
entry = g_list_next(entry);
}

if (!entry) {
node->children = g_list_append(node->children, obj);
obj->parent = node;
}
}
}

static struct topo_obj* add_cache_domain_to_package(struct topo_obj *cache,
@@ -189,7 +205,7 @@ static struct topo_obj* add_cache_domain_to_package(struct topo_obj *cache,
cache->parent = package;
}

if (nodeid > -1)
if (!numa_avail || (nodeid > -1))
add_numa_node_to_topo_obj(package, nodeid);

return package;
@@ -236,7 +252,7 @@ static struct topo_obj* add_cpu_to_cache_domain(struct topo_obj *cpu,
cpu->parent = (struct topo_obj *)cache;
}

if (nodeid > -1)
if (!numa_avail || (nodeid > -1))
add_numa_node_to_topo_obj(cache, nodeid);

return cache;
@@ -130,20 +130,21 @@ static void place_irq_in_node(struct irq_info *info, void *data __attribute__((u
if ((info->level == BALANCE_NONE) && cpus_empty(banned_cpus))
return;

if (irq_numa_node(info)->number != -1) {
if (irq_numa_node(info)->number != -1 || !numa_avail) {
/*
* Need to make sure this node is elligible for migration
* given the banned cpu list
*/
if (!cpus_intersects(irq_numa_node(info)->mask, unbanned_cpus))
goto find_placement;
/*
* This irq belongs to a device with a preferred numa node
* put it on that node
*/
* This irq belongs to a device with a preferred numa node
* put it on that node
*/
migrate_irq(&rebalance_irq_list, &irq_numa_node(info)->interrupts, info);
info->assigned_obj = irq_numa_node(info);
irq_numa_node(info)->load += info->load + 1;

return;
}

0 comments on commit 9f7b1a9

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