------- Comment From <email address hidden> 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.
------- Comment From <email address hidden> 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. to_cpus_ v2_int( ) which check that the cpu belongs to that node.
Fix is to check node is valid before calling numa_node_
$ diff -urN libnuma.c libnuma.c.new alloc(ncpus) ; to_cpus_ v2_int( node, bmp); isbitset( bmp, cpu)){ numa_nodes_ ptr,node) ) { to_cpus_ v2_int( node, bmp); isbitset( bmp, cpu)){
--- 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_
nnodes = numa_max_node();
for (node = 0; node <= nnodes; node++){
- numa_node_
- if (numa_bitmask_
- ret = node;
- goto end;
+ if (_getbit(
+ numa_node_
+ if (numa_bitmask_
+ ret = node;
+ goto end;
+ }
}
}
ret = -1;