------- Comment From [email protected] 2014-11-18 15:49 EDT-------
We have found the issue - On a bare LE system, nodes are name 0, 1 , 16 , 17 
and the library search for these nodes for the meminfo file however it search 
for nodes 0, 1, 2 for the cpumap file.
On a VM started by qemu, the nodes are named 0,1,2,3 and the problem doesn't 
occures.

In libnuma.c, function numa_node_of_cpu() doesn't use previously created list 
of valid nodes but use the entire array indexed with the maximum number of 
nodes available on the system.
Fix is to check node is valid before calling numa_node_to_cpus_v2_int() which 
check that the cpu belongs to that node.

$ diff -urN libnuma.c libnuma.c.new
--- libnuma.c   2014-11-18 10:44:32.563683894 -0500
+++ libnuma.c.new       2014-11-18 10:44:04.431683894 -0500
@@ -1403,10 +1403,12 @@
bmp = numa_bitmask_alloc(ncpus);
nnodes = numa_max_node();
for (node = 0; node <= nnodes; node++){
-               numa_node_to_cpus_v2_int(node, bmp);
-               if (numa_bitmask_isbitset(bmp, cpu)){
-                       ret = node;
-                       goto end;
+               if (_getbit(numa_nodes_ptr,node)) {
+                       numa_node_to_cpus_v2_int(node, bmp);
+                       if (numa_bitmask_isbitset(bmp, cpu)){
+                               ret = node;
+                               goto end;
+                       }
}
}
ret = -1;

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1358835

Title:
  numa_node_of_cpu() returns warning  when cpu_index > 79

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/numactl/+bug/1358835/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to