Skip to content

Commit

Permalink
numatopology: Add check for cpu-less nodes
Browse files Browse the repository at this point in the history
Some machine configurations with GPUs have nodes without cpu
configured. This patch skips check for those nodes.

Signed-off-by: Harish <harish@linux.vnet.ibm.com>
  • Loading branch information
Harish authored and andikleen committed Jun 17, 2019
1 parent b0a9ca3 commit 9dd617c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/checktopology
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ numnodes=$(ls -1d /sys/devices/system/node/node[0-9]* | wc -l)

nccpus=$(numactl --hardware | grep cpus | sed 's/node.*cpus://' | wc -w )
ncnodes=$(numactl --hardware | grep -c 'node.*size' )
node_has_cpus=""

if [ $numnodes != $ncnodes ] ; then
echo "numactl --hardware doesnt report all nodes"
Expand All @@ -23,10 +24,21 @@ if [ $numcpus != $nccpus -a \( $[$nccpus / $numnodes] != $numcpus \) ] ; then
exit 1
fi

if [ -s /sys/devices/system/node/has_cpu ]; then
node_has_cpus=$(cat /sys/devices/system/node/has_cpu | sed 's/,/ /')
fi

numactl --hardware | grep cpus | while read n ; do
node=${n/ cpus*/}
node=${node/ /}
cpus=${n/*: /}
check_node=$(echo $node | sed 's/node//')
if [[ -n ${node_has_cpus} ]]; then
if ! [[ "${node_has_cpus}" == *"$check_node"* ]]; then
echo "Skipping cpu less $node"
continue
fi
fi
k=0
for i in $cpus ; do
if [ ! -h "/sys/devices/system/node/$node/cpu$i" ] ; then
Expand Down

0 comments on commit 9dd617c

Please sign in to comment.