A great way to troll Ops is to bring up Hyper-threading. So let's document the debate and situation.
Once upon a time, HT was a new feature which Linux did not support well, due to the similarities and differences between SMP and HT. For this reason the conventional wisdom has been to disable HT in the BIOS.
However that was over 10 years ago, HT is now well supported on Linux, and the question becomes one of suitability to a workload.
A security issue was raised back in 2005 concerning HT. FreeBSD disabled HT in the kernel to mitigate the issue. The Linux kernel community did not. Interesting discussion in:
The original security disclosure is in:
HT is said to increase performance of multi-threaded code by doubling the number of threads executed in parallel. That claim is regularly contested though:
HT is said to decrease performance of HPC-style compute-intensive workloads such as floating point calculations. Links above apply as well for this.
- Most clusters have a mix of HT enabled/disabled hosts. This is a defect.
- Platform-specific documentation continues to say to disable HT during initial setup, but doesn't explain why
sudo lshw -class cpu | grep config
cat /sys/devices/system/cpu/cpu0/topology/thread_siblings | grep -q ',00000001$' && echo DISABLED || echo ENABLED
#!/bin/bash CPUFILE=/proc/cpuinfo test -f $CPUFILE || exit 1 # get number of physical CPUs NUMPHY=`grep "physical id" $CPUFILE | sort -u | wc -l` # get number of logical CPUs NUMLOG=`grep "processor" $CPUFILE | wc -l` # get number of cores per physical NUMCORE=`grep "core id" $CPUFILE | sort -u | wc -l` # calculate number of logical cores per physical core let NUMHTS=$NUMLOG/$NUMPHY/$NUMCORE if [ $NUMHTS -gt 1 ] ; then echo "HT=ON ($NUMLOG logical / ($NUMPHY physical * $NUMCORE cores each) = $NUMHTS logical per core)" else echo "HT=OFF ($NUMLOG logical / ($NUMPHY physical * $NUMCORE cores each) = $NUMHTS logical per core)" fi
Potentially this Puppet Facter Fact could also be extended to report HT status:
- "Hyper-threading" on Wikipedia
- Platform-specific documentation/HP_DL3N0#Enable/Disable Hyperthreading
- Platform-specific documentation/Dell_PowerEdge_RN20#Initial System Setup
- Platform-specific documentation/Dell_PowerEdge_RN10#Initial System Setup