There are times when you need to know whether hyper-threading is enabled without the luxury to reboot the system to check the BIOS or You know for sure, that it is enabled in the BIOS, but you need to check at the node level.
You can simply look at the output of /proc/cpuinfo and compare the siblings with the cpu cores fields. Although /proc/cpuinfo shows you all the logical CPUs (processor field) in the system, the siblings field holds the number of logical CPUs for the physical CPU this entry belongs to (including both the cores and the hyper-threaded LCPUs).
If the number of cpu cores is the same as the number of siblings, hyper-threading is disabled.
Below are different examples of how to check if Hyper threading is enabled.
- Using information from /proc/cpuinfo
processor : 0
siblings : 4
cpu cores : 2
In the above example; the LCPU #0 (the first logical CPU in your system) is one of the 4 logical CPUs on the physical CPU that has 2 cores. So yes, hyper-threading is enabled.
flags : fpu vme ht de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt aes xsave avx f16c rdrand hypervisor lahf_lm ida arat epb pln pts dtherm fsgsbase smep
In the above, you can see the “ht” in the flags section. This also tells you that hyper-threading is enabled.
- Using the lscpu command
Thread(s) per core: 2
Core(s) per socket: 6
As you can see, number of threads per core is 2, so it’s HT enabled.
- Another way to check us to install dmidecode (if it isnt already available).
Socket Designation: Node 1 Socket 1
Socket Designation: Node 1 Socket 2
In the above, It tells you that HT is enabled.
Core Count: 4
Thread Count: 8
Again, here it tells you the thread count of the cores.
Leave your comments, if you know any other ways to check for hyper-threading at node level.