You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
574 B

diff --git a/cputree.c b/cputree.c
index 4d09c0e..0f14cfb 100644
--- a/cputree.c
+++ b/cputree.c
@@ -357,6 +357,8 @@ static void do_one_cpu(char *path)
nodeid=-1;
if (numa_avail) {
+ struct topo_obj *node;
+
dir = opendir(path);
do {
entry = readdir(dir);
@@ -368,6 +370,12 @@ static void do_one_cpu(char *path)
}
} while (entry);
closedir(dir);
+
+ node = get_numa_node(nodeid);
+ if (node && (cpus_weight(package_mask) > cpus_weight(node->mask))) {
+ cpus_and(package_mask, package_mask, node->mask);
+ packageid = nodeid;
+ }
}
/*