thrlo=${thrlo:-1}
thrhi=${thrhi:-4096}
+# NUMA support
+# User provided script that returns a cpu list from a specified device.
+# Implementation depends on the type of device (scsi/raw, with/without
+# multipath, technology fc/sas/ib)
+# For example:
+# $ cat bin/dev2cpus
+# #!/bin/bash
+# dev=$(basename $1)
+# pci=$(readlink -f /sys/class/block/$dev | cut -d/ -f1-5)
+# cat ${pci}/local_cpulist
+dev2cpus=${dev2cpus:-""}
+
#####################################################################
# leave the rest of this alone unless you know what you're doing...
# and max # threads one instance will spawn
SG_MAX_QUEUE=16
+# numactl command
+NUMACTL=${NUMACTL:-"/usr/bin/numactl"}
+
unique () {
echo "$@" | xargs -n1 echo | sort -u
}
done
unique_hosts=(`unique ${hosts[@]}`)
+# get device cpu list
+devcpus=()
+if [ -n "$dev2cpus" ]; then
+ for ((i=0; i < $ndevs; i++)); do
+ devcpus[$i]=$(remote_shell ${hosts[$i]} $dev2cpus ${devs[$i]})
+ done
+fi
+
# map given device names into SG device names
if [ "$scsidevs" ]; then
# make sure sg kernel module is loaded
outf="of=$dev"
skip=seek
fi
+ if [ -n "${devcpus[$i]}" -a -x "$NUMACTL" ]; then
+ numacmd="$NUMACTL --physcpubind=${devcpus[$i]} --localalloc"
+ else
+ numacmd=""
+ fi
for ((j=0;j<crg;j++)); do
echo >> ${cmdsf}_${host} \
+ "$numacmd " \
"sgp_dd 2> ${tmpf}_${i}_${j} $inf $outf " \
"${skip}=$((boundary+j*blocks)) " \
"thr=$((thr/crg)) count=$count bs=${bs[$i]} " \