numa/numa01.sh: fixed errors under noncontinuous numa nodes list
The previous code numa01.sh thought all NUMA system had continuous
numa nodes list, and node id started from 0, but in fact it does not.
There are lots of system contains noncontinuous numa nodes list
e.g:
# numactl --hardware
available: 4 nodes (0,2,4,7)
node 0 cpus: 0 4 8 12 16 20 24 28
node 0 size: 4061 MB
node 0 free: 3756 MB
node 2 cpus: 1 5 9 13 17 21 25 29
node 2 size: 4096 MB
node 2 free: 3196 MB
node 4 cpus: 2 6 10 14 18 22 26 30
node 4 size: 4096 MB
node 4 free: 3885 MB
node 7 cpus: 3 7 11 15 19 23 27 31
node 7 size: 4095 MB
node 7 free: 3947 MB
node distances:
node 0 2 4 7
0: 10 20 20 20
2: 20 10 20 20
4: 20 20 10 20
7: 20 20 20 10
in such discontinuous nodes system, numa01.sh would fail with
such error log:
libnuma: Warning: node argument 1 is out of range
The patch fixed it, and removed some useless/redundancy val/func,
such as 'max_node' val and 'getmax' func, also make some cleanup.
Signed-off-by: Zhouping Liu <zliu@redhat.com>
Acked-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
1 file changed