Disable hyperthreading from within Linux (no access to BIOS)
You can do this at runtime if you want to. I found a nice solution described here: http://www.absolutelytech.com/2011/08/01/how-to-disable-cpu-cores-in-linux/
Step 1: Identify the linux CPUs you want to switch off:
cat /proc/cpuinfo
Look for the CPUs that have the same "core id", you want to switch off one of each pair.
Step 2: Switch off the hyperthreading CPUs (in my case the last four of the total 8 "CPUs" seen by Linux)
echo 0 > /sys/devices/system/cpu/cpu4/online
echo 0 > /sys/devices/system/cpu/cpu5/online
echo 0 > /sys/devices/system/cpu/cpu6/online
echo 0 > /sys/devices/system/cpu/cpu7/online
You could setup yourself a script that you run just after system start.
Newer Kernels provide a Simultaneous Multithreading (SMT) control.
You can check the state of SMT with;
cat /sys/devices/system/cpu/smt/active
Change the state with
echo off > /sys/devices/system/cpu/smt/control
Options are;
- on
- off
- forceoff
We have tested this with Linux Kernel 4.4.0