diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2008-09-30 16:12:11 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2008-09-30 16:12:11 -0300 |
commit | 26311c48a8a2d544472c8a2ff97373935b1768a5 (patch) | |
tree | 1d07776416c62df7d7bb53f594bc1f75f9473398 | |
parent | f75c8d50e0a4d0e1ca5e1f679c118c76358fe996 (diff) | |
download | tuna-26311c48a8a2d544472c8a2ff97373935b1768a5.tar.gz |
testuna: Add per CPU socket tests
Include & isolate CPU sockets and move a thread to a socket
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rwxr-xr-x | testuna | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -28,6 +28,10 @@ get_nr_processors() { echo $(grep -i "^processor.*: " /proc/cpuinfo | tail -1 | cut -d ':' -f 2) } +get_nr_cpu_sockets() { + echo $(grep "^physical id" /proc/cpuinfo | cut -d: -f2 | sort -u | wc -l) +} + die() { [ -z "$VERBOSE" ] && echo -n "$2: " echo $1 @@ -174,6 +178,27 @@ AFFINITY=0x$(get_affinity 1) die_if_not_equal $((AFFINITY & NEW_AFFINITY)) $NEW_AFFINITY "Moving init to just first and last processor" +NR_CPU_SOCKETS=$(get_nr_cpu_sockets) +if [ $NR_CPU_SOCKETS -ge 2 ]; then + CPU1_SIBLINGS=$(printf "%d" 0x$(cat /sys/devices/system/cpu/cpu1/topology/core_siblings | cut -d',' -f2)) + CPU1_SOCKET=$(cat /sys/devices/system/cpu/cpu1/topology/physical_package_id) + + tuna --sockets=$CPU1_SOCKET --isolate + AFFINITY=0x$(get_affinity 1) + die_if_not_zero $((AFFINITY & CPU1_SIBLINGS)) \ + "Verifying isolation of socket $CPU1_SOCKET" + + tuna --sockets=$CPU1_SOCKET --include + AFFINITY=0x$(get_affinity 1) + die_if_not_equal $((AFFINITY & CPU1_SIBLINGS)) $CPU1_SIBLINGS \ + "Verifying inclusion of socket $CPU1_SOCKET" + + tuna --sockets=$CPU1_SOCKET --isolate + tuna --sockets=$CPU1_SOCKET --thread 1 --move + AFFINITY=0x$(get_affinity 1) + die_if_not_equal $((AFFINITY & CPU1_SIBLINGS)) $CPU1_SIBLINGS "Moving init to CPU socket $CPU1_SOCKET" +fi + taskset -p $INITIAL_INIT_AFFINITY 1 > /dev/null rtctl --file $INITIAL reset |