Files
nanoBench/disable-HT.sh
Andreas Abel a01b9742c7 Initial commit
2019-02-20 14:57:43 +01:00

15 lines
417 B
Bash
Executable File

#!/bin/bash
if [ "$EUID" -ne 0 ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
for cpu in /sys/devices/system/cpu/cpu[1-9]*; do
if [ -e "$cpu/topology/thread_siblings_list" ]; then
sibling=$(awk -F '[^0-9]' '{ print $2 }' $cpu/topology/thread_siblings_list)
if [ ! -z $sibling ]; then
echo 0 > "/sys/devices/system/cpu/cpu$sibling/online"
fi
fi
done